Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
ecd0bfa8
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ecd0bfa8
编写于
10月 23, 1999
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Look Ma, no MAX_PARSE_BUFFER! (At least not in the backend.
pg_dump and interfaces/odbc still need some work.)
上级
627b5e9c
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
127 addition
and
182 deletion
+127
-182
src/backend/access/common/indextuple.c
src/backend/access/common/indextuple.c
+5
-5
src/backend/access/index/istrat.c
src/backend/access/index/istrat.c
+2
-2
src/backend/libpq/auth.c
src/backend/libpq/auth.c
+17
-15
src/backend/libpq/hba.c
src/backend/libpq/hba.c
+20
-13
src/backend/libpq/password.c
src/backend/libpq/password.c
+4
-4
src/backend/libpq/portal.c
src/backend/libpq/portal.c
+3
-3
src/backend/libpq/pqcomm.c
src/backend/libpq/pqcomm.c
+10
-11
src/backend/libpq/pqformat.c
src/backend/libpq/pqformat.c
+2
-2
src/backend/libpq/util.c
src/backend/libpq/util.c
+11
-5
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+3
-9
src/backend/utils/mmgr/palloc.c
src/backend/utils/mmgr/palloc.c
+2
-2
src/bin/pg_dump/common.c
src/bin/pg_dump/common.c
+2
-5
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+12
-16
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dump.h
+13
-2
src/include/access/ibit.h
src/include/access/ibit.h
+3
-4
src/include/access/itup.h
src/include/access/itup.h
+1
-2
src/include/libpq/hba.h
src/include/libpq/hba.h
+2
-11
src/include/libpq/libpq.h
src/include/libpq/libpq.h
+7
-7
src/include/miscadmin.h
src/include/miscadmin.h
+1
-4
src/include/postgres.h
src/include/postgres.h
+5
-10
src/include/tcop/fastpath.h
src/include/tcop/fastpath.h
+1
-2
src/include/utils/memutils.h
src/include/utils/memutils.h
+1
-48
未找到文件。
src/backend/access/common/indextuple.c
浏览文件 @
ecd0bfa8
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.3
8 1999/07/19 07:07:15 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.3
9 1999/10/23 03:13:20 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -44,10 +44,10 @@ index_formtuple(TupleDesc tupleDescriptor,
uint16
tupmask
=
0
;
int
numberOfAttributes
=
tupleDescriptor
->
natts
;
if
(
numberOfAttributes
>
MaxIndexAttributeNumber
)
elog
(
ERROR
,
"index_formtuple: numberOfAttributes of %d > %d"
,
numberOfAttributes
,
MaxIndexAttributeNumber
);
/* XXX shouldn't this test be '>' ? */
if
(
numberOfAttributes
>=
INDEX_MAX_KEYS
)
elog
(
ERROR
,
"index_formtuple: numberOfAttributes %d >= %d"
,
numberOfAttributes
,
INDEX_MAX_KEYS
);
for
(
i
=
0
;
i
<
numberOfAttributes
&&
!
hasnull
;
i
++
)
{
...
...
src/backend/access/index/istrat.c
浏览文件 @
ecd0bfa8
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.3
6 1999/09/18 19:06:04
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.3
7 1999/10/23 03:13:20
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -544,7 +544,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
StrategyMap
map
;
AttrNumber
attributeNumber
;
int
attributeIndex
;
Oid
operatorClassObjectId
[
MaxIndexAttributeNumber
];
Oid
operatorClassObjectId
[
INDEX_MAX_KEYS
];
if
(
!
IsBootstrapProcessingMode
())
{
...
...
src/backend/libpq/auth.c
浏览文件 @
ecd0bfa8
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.4
1 1999/09/27 03:12:58 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.4
2 1999/10/23 03:13:21 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -96,23 +96,25 @@ pg_krb4_recvauth(Port *port)
version
);
if
(
status
!=
KSUCCESS
)
{
snprintf
(
PQerrormsg
,
ERROR_MSG_LENGTH
,
"pg_krb4_recvauth: kerberos error: %s
\n
"
,
krb_err_txt
[
status
]);
snprintf
(
PQerrormsg
,
PQERRORMSG_LENGTH
,
"pg_krb4_recvauth: kerberos error: %s
\n
"
,
krb_err_txt
[
status
]);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
return
STATUS_ERROR
;
}
if
(
strncmp
(
version
,
PG_KRB4_VERSION
,
KRB_SENDAUTH_VLEN
))
{
snprintf
(
PQerrormsg
,
ERROR_MSG_LENGTH
,
"pg_krb4_recvauth: protocol version !=
\"
%s
\"\n
"
,
PG_KRB4_VERSION
);
snprintf
(
PQerrormsg
,
PQERRORMSG_LENGTH
,
"pg_krb4_recvauth: protocol version !=
\"
%s
\"\n
"
,
PG_KRB4_VERSION
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
return
STATUS_ERROR
;
}
if
(
strncmp
(
port
->
user
,
auth_data
.
pname
,
SM_USER
))
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_krb4_recvauth: name
\"
%s
\"
!=
\"
%s
\"\n
"
,
port
->
user
,
auth_data
.
pname
);
fputs
(
PQerrormsg
,
stderr
);
...
...
@@ -126,8 +128,8 @@ pg_krb4_recvauth(Port *port)
static
int
pg_krb4_recvauth
(
Port
*
port
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
"pg_krb4_recvauth: Kerberos not implemented on this server.
\n
"
);
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_krb4_recvauth: Kerberos not implemented on this server.
\n
"
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
@@ -220,7 +222,7 @@ pg_krb5_recvauth(Port *port)
*
hostp
=
'\0'
;
if
(
code
=
krb5_parse_name
(
servbuf
,
&
server
))
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_krb5_recvauth: Kerberos error %d in krb5_parse_name
\n
"
,
code
);
com_err
(
"pg_krb5_recvauth"
,
code
,
"in krb5_parse_name"
);
return
STATUS_ERROR
;
...
...
@@ -253,7 +255,7 @@ pg_krb5_recvauth(Port *port)
(
krb5_ticket
**
)
NULL
,
(
krb5_authenticator
**
)
NULL
))
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_krb5_recvauth: Kerberos error %d in krb5_recvauth
\n
"
,
code
);
com_err
(
"pg_krb5_recvauth"
,
code
,
"in krb5_recvauth"
);
krb5_free_principal
(
server
);
...
...
@@ -268,7 +270,7 @@ pg_krb5_recvauth(Port *port)
*/
if
((
code
=
krb5_unparse_name
(
client
,
&
kusername
)))
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_krb5_recvauth: Kerberos error %d in krb5_unparse_name
\n
"
,
code
);
com_err
(
"pg_krb5_recvauth"
,
code
,
"in krb5_unparse_name"
);
krb5_free_principal
(
client
);
...
...
@@ -277,7 +279,7 @@ pg_krb5_recvauth(Port *port)
krb5_free_principal
(
client
);
if
(
!
kusername
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_krb5_recvauth: could not decode username
\n
"
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
@@ -286,7 +288,7 @@ pg_krb5_recvauth(Port *port)
kusername
=
pg_an_to_ln
(
kusername
);
if
(
strncmp
(
username
,
kusername
,
SM_USER
))
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_krb5_recvauth: name
\"
%s
\"
!=
\"
%s
\"\n
"
,
port
->
user
,
kusername
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
@@ -301,7 +303,7 @@ pg_krb5_recvauth(Port *port)
static
int
pg_krb5_recvauth
(
Port
*
port
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_krb5_recvauth: Kerberos not implemented on this server.
\n
"
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
@@ -356,7 +358,7 @@ pg_passwordv0_recvauth(void *arg, PacketLen len, void *pkt)
if
(
user
==
NULL
||
password
==
NULL
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"pg_password_recvauth: badly formed password packet.
\n
"
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
src/backend/libpq/hba.c
浏览文件 @
ecd0bfa8
...
...
@@ -5,7 +5,7 @@
* wherein you authenticate a user by seeing what IP address the system
* says he comes from and possibly using ident).
*
* $Id: hba.c,v 1.4
8 1999/09/27 03:12:59 momjian
Exp $
* $Id: hba.c,v 1.4
9 1999/10/23 03:13:21 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -19,9 +19,18 @@
#include <unistd.h>
#include "postgres.h"
#include "libpq/libpq.h"
#include "miscadmin.h"
#define MAX_TOKEN 80
/* Maximum size of one token in the configuration file */
#define IDENT_USERNAME_MAX 512
/* Max size of username ident server can return */
/* Some standard C libraries, including GNU, have an isblank() function.
Others, including Solaris, do not. So we have our own.
*/
...
...
@@ -32,7 +41,6 @@ isblank(const char c)
}
static
void
next_token
(
FILE
*
fp
,
char
*
buf
,
const
int
bufsz
)
{
...
...
@@ -302,9 +310,8 @@ process_hba_record(FILE *file, hbaPort *port, bool *matches_p, bool *error_p)
return
;
syntax:
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"process_hba_record: invalid syntax in pg_hba.conf file
\n
"
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
@@ -397,7 +404,7 @@ find_hba_entry(hbaPort *port, bool *hba_ok_p)
{
/* Old config file exists. Tell this guy he needs to upgrade. */
close
(
fd
);
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"A file exists by the name used for host-based authentication "
"in prior releases of Postgres (%s). The name and format of "
"the configuration file have changed, so this file should be "
...
...
@@ -421,7 +428,7 @@ find_hba_entry(hbaPort *port, bool *hba_ok_p)
{
/* The open of the config file failed. */
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"find_hba_entry: Host-based authentication config file "
"does not exist or permissions are not setup correctly! "
"Unable to open file
\"
%s
\"
.
\n
"
,
...
...
@@ -553,7 +560,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
sock_fd
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_IP
);
if
(
sock_fd
==
-
1
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"Failed to create socket on which to talk to Ident server. "
"socket() returned errno = %s (%d)
\n
"
,
strerror
(
errno
),
errno
);
...
...
@@ -590,7 +597,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
}
if
(
rc
!=
0
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"Unable to connect to Ident server on the host which is "
"trying to connect to Postgres "
"(IP address %s, Port %d). "
...
...
@@ -610,7 +617,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
rc
=
send
(
sock_fd
,
ident_query
,
strlen
(
ident_query
),
0
);
if
(
rc
<
0
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"Unable to send query to Ident server on the host which is "
"trying to connect to Postgres (Host %s, Port %d),"
"even though we successfully connected to it. "
...
...
@@ -627,7 +634,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
rc
=
recv
(
sock_fd
,
ident_response
,
sizeof
(
ident_response
)
-
1
,
0
);
if
(
rc
<
0
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"Unable to receive response from Ident server "
"on the host which is "
"trying to connect to Postgres (Host %s, Port %d),"
...
...
@@ -692,7 +699,7 @@ parse_map_record(FILE *file,
return
;
}
}
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"Incomplete line in pg_ident: %s"
,
file_map
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
@@ -775,7 +782,7 @@ verify_against_usermap(const char *pguser,
if
(
usermap_name
[
0
]
==
'\0'
)
{
*
checks_out_p
=
false
;
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"verify_against_usermap: hba configuration file does not "
"have the usermap field filled in in the entry that pertains "
"to this connection. That field is essential for Ident-based "
...
...
@@ -813,7 +820,7 @@ verify_against_usermap(const char *pguser,
*
checks_out_p
=
false
;
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"verify_against_usermap: usermap file for Ident-based "
"authentication "
"does not exist or permissions are not setup correctly! "
...
...
src/backend/libpq/password.c
浏览文件 @
ecd0bfa8
/*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: password.c,v 1.2
5 1999/07/17 20:17:02 momjian
Exp $
* $Id: password.c,v 1.2
6 1999/10/23 03:13:21 tgl
Exp $
*
*/
...
...
@@ -34,7 +34,7 @@ verify_password(char *auth_arg, char *user, char *password)
#endif
if
(
!
pw_file
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"verify_password: couldn't open password file '%s'
\n
"
,
pw_file_fullname
);
fputs
(
PQerrormsg
,
stderr
);
...
...
@@ -79,7 +79,7 @@ verify_password(char *auth_arg, char *user, char *password)
return
STATUS_OK
;
}
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"verify_password: password mismatch for '%s'.
\n
"
,
user
);
fputs
(
PQerrormsg
,
stderr
);
...
...
@@ -91,7 +91,7 @@ verify_password(char *auth_arg, char *user, char *password)
}
}
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"verify_password: user '%s' not found in password file.
\n
"
,
user
);
fputs
(
PQerrormsg
,
stderr
);
...
...
src/backend/libpq/portal.c
浏览文件 @
ecd0bfa8
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: portal.c,v 1.2
7 1999/07/17 20:17:02 momjian
Exp $
* $Id: portal.c,v 1.2
8 1999/10/23 03:13:22 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -66,7 +66,7 @@ in_range(char *msg, int value, int min, int max)
{
if
(
value
<
min
||
value
>=
max
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"FATAL: %s, %d is not in range [%d,%d)
\n
"
,
msg
,
value
,
min
,
max
);
pqdebug
(
"%s"
,
PQerrormsg
);
fputs
(
PQerrormsg
,
stderr
);
...
...
@@ -80,7 +80,7 @@ valid_pointer(char *msg, void *ptr)
{
if
(
!
ptr
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
"FATAL: %s
\n
"
,
msg
);
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"FATAL: %s
\n
"
,
msg
);
pqdebug
(
"%s"
,
PQerrormsg
);
fputs
(
PQerrormsg
,
stderr
);
return
0
;
...
...
src/backend/libpq/pqcomm.c
浏览文件 @
ecd0bfa8
...
...
@@ -28,7 +28,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pqcomm.c,v 1.8
4 1999/09/27 03:12:59 momjian
Exp $
* $Id: pqcomm.c,v 1.8
5 1999/10/23 03:13:22 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -195,7 +195,7 @@ StreamServerPort(char *hostName, unsigned short portName, int *fdP)
if
((
fd
=
socket
(
family
,
SOCK_STREAM
,
0
))
<
0
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"FATAL: StreamServerPort: socket() failed: %s
\n
"
,
strerror
(
errno
));
fputs
(
PQerrormsg
,
stderr
);
...
...
@@ -211,7 +211,7 @@ StreamServerPort(char *hostName, unsigned short portName, int *fdP)
if
((
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
char
*
)
&
one
,
sizeof
(
one
)))
==
-
1
)
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"FATAL: StreamServerPort: setsockopt(SO_REUSEADDR) failed: %s
\n
"
,
strerror
(
errno
));
fputs
(
PQerrormsg
,
stderr
);
...
...
@@ -266,20 +266,19 @@ StreamServerPort(char *hostName, unsigned short portName, int *fdP)
err
=
bind
(
fd
,
&
saddr
.
sa
,
len
);
if
(
err
<
0
)
{
snprintf
(
PQerrormsg
,
ERROR_MSG_LENGTH
,
"FATAL: StreamServerPort: bind() failed: %s
\n
"
,
snprintf
(
PQerrormsg
,
PQERRORMSG_LENGTH
,
"FATAL: StreamServerPort: bind() failed: %s
\n
"
"
\t
Is another postmaster already running on that port?
\n
"
,
strerror
(
errno
));
strcat
(
PQerrormsg
,
"
\t
Is another postmaster already running on that port?
\n
"
);
if
(
family
==
AF_UNIX
)
{
snprintf
(
PQerrormsg
+
strlen
(
PQerrormsg
),
ERROR_
MSG_LENGTH
-
strlen
(
PQerrormsg
),
PQERROR
MSG_LENGTH
-
strlen
(
PQerrormsg
),
"
\t
If not, remove socket node (%s) and retry.
\n
"
,
sock_path
);
}
else
strcat
(
PQerrormsg
,
"
\t
If not, wait a few seconds and retry.
\n
"
);
snprintf
(
PQerrormsg
+
strlen
(
PQerrormsg
),
PQERRORMSG_LENGTH
-
strlen
(
PQerrormsg
),
"
\t
If not, wait a few seconds and retry.
\n
"
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
return
STATUS_ERROR
;
...
...
src/backend/libpq/pqformat.c
浏览文件 @
ecd0bfa8
...
...
@@ -15,7 +15,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pqformat.c,v 1.1
0 1999/09/12 22:27:47 scrappy
Exp $
* $Id: pqformat.c,v 1.1
1 1999/10/23 03:13:22 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -213,7 +213,7 @@ pq_endmessage(StringInfo buf)
{
if
(
pq_putmessage
(
'\0'
,
buf
->
data
,
buf
->
len
))
{
snprintf
(
PQerrormsg
,
ERROR_
MSG_LENGTH
,
snprintf
(
PQerrormsg
,
PQERROR
MSG_LENGTH
,
"FATAL: pq_endmessage failed: errno=%d
\n
"
,
errno
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
src/backend/libpq/util.c
浏览文件 @
ecd0bfa8
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: util.c,v 1.1
3 1999/07/17 20:17:03 momjian
Exp $
* $Id: util.c,v 1.1
4 1999/10/23 03:13:22 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -22,6 +22,15 @@
#include "libpq/libpq.h"
/* ----------------
* global variables for backend libpq
* ----------------
*/
char
PQerrormsg
[
PQERRORMSG_LENGTH
];
int
PQtracep
=
0
;
/* 1 to print out debugging messages */
FILE
*
debug_port
=
(
FILE
*
)
NULL
;
/* ----------------
* exceptions
* ----------------
...
...
@@ -30,15 +39,12 @@ Exception MemoryError = {"Memory Allocation Error"};
Exception
PortalError
=
{
"Invalid arguments to portal functions"
};
Exception
PostquelError
=
{
"Sql Error"
};
Exception
ProtocolError
=
{
"Protocol Error"
};
char
PQerrormsg
[
ERROR_MSG_LENGTH
];
int
PQtracep
=
0
;
/* 1 to print out debugging messages */
FILE
*
debug_port
=
(
FILE
*
)
NULL
;
/* ----------------------------------------------------------------
* PQ utility routines
* ----------------------------------------------------------------
*/
void
pqdebug
(
char
*
target
,
char
*
msg
)
{
...
...
src/backend/tcop/postgres.c
浏览文件 @
ecd0bfa8
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.13
4 1999/10/08 05:36:58 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.13
5 1999/10/23 03:13:22 tgl
Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -22,16 +22,10 @@
#include <sys/time.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/
param
.h>
#include <sys/
socket
.h>
#include "postgres.h"
#ifndef MAXHOSTNAMELEN
#include <netdb.h>
#endif
#ifndef MAXHOSTNAMELEN
/* for MAXHOSTNAMELEN under sco3.2v5.0.2 */
#include <sys/socket.h>
#endif
#include <errno.h>
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
...
...
@@ -1500,7 +1494,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
if
(
!
IsUnderPostmaster
)
{
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"$Revision: 1.13
4 $ $Date: 1999/10/08 05:36:58
$
\n
"
);
puts
(
"$Revision: 1.13
5 $ $Date: 1999/10/23 03:13:22
$
\n
"
);
}
/*
...
...
src/backend/utils/mmgr/palloc.c
浏览文件 @
ecd0bfa8
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/palloc.c,v 1.1
4 1999/07/17 20:18:15 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/palloc.c,v 1.1
5 1999/10/23 03:13:24 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -35,7 +35,7 @@ pstrdup(char *string)
int
len
;
nstr
=
palloc
(
len
=
strlen
(
string
)
+
1
);
MemoryCo
py
(
nstr
,
string
,
len
);
memc
py
(
nstr
,
string
,
len
);
return
nstr
;
}
src/bin/pg_dump/common.c
浏览文件 @
ecd0bfa8
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.3
3 1999/07/17 20:18:18 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.3
4 1999/10/23 03:13:26 tgl
Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
...
...
@@ -20,12 +20,9 @@
#include <ctype.h>
#include <sys/param.h>
/* for MAXHOSTNAMELEN on most */
#ifdef solaris_sparc
#include <netdb.h>
/* for MAXHOSTNAMELEN on some */
#endif
#include "postgres.h"
#include "libpq-fe.h"
#ifndef HAVE_STRDUP
#include "strdup.h"
...
...
src/bin/pg_dump/pg_dump.c
浏览文件 @
ecd0bfa8
...
...
@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.12
2 1999/10/10 17:00:26 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.12
3 1999/10/23 03:13:26 tgl
Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
...
...
@@ -53,32 +53,28 @@
#include <unistd.h>
/* for getopt() */
#include <ctype.h>
#include <sys/param.h>
/* for MAXHOSTNAMELEN on most */
#ifdef solaris_sparc
#include <netdb.h>
/* for MAXHOSTNAMELEN on some */
#endif
#include "postgres.h"
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#include "access/attnum.h"
#include "access/htup.h"
#include "catalog/pg_type.h"
#include "catalog/pg_language.h"
#include "catalog/pg_index.h"
#include "catalog/pg_language.h"
#include "catalog/pg_trigger.h"
#include "
access/attnum
.h"
#include "
catalog/pg_type
.h"
#include "libpq-fe.h"
#ifndef HAVE_STRDUP
#include "strdup.h"
#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#include "pg_dump.h"
static
void
dumpSequence
(
FILE
*
fout
,
TableInfo
tbinfo
);
...
...
src/bin/pg_dump/pg_dump.h
浏览文件 @
ecd0bfa8
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_dump.h,v 1.
39 1999/05/26 21:51:11
tgl Exp $
* $Id: pg_dump.h,v 1.
40 1999/10/23 03:13:26
tgl Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
...
...
@@ -19,7 +19,16 @@
*-------------------------------------------------------------------------
*/
#include <catalog/pg_index.h>
#ifndef PG_DUMP_H
#define PG_DUMP_H
#include "catalog/pg_index.h"
/*
* Very temporary hack --- remove this when all pg_dump's uses of it are gone!
*/
#define MAX_QUERY_SIZE (BLCKSZ*2)
/* The *Info data structures run-time C structures used to store
system catalog information */
...
...
@@ -225,3 +234,5 @@ extern void dumpTables(FILE *fout, TableInfo *tbinfo, int numTables,
extern
void
dumpIndices
(
FILE
*
fout
,
IndInfo
*
indinfo
,
int
numIndices
,
TableInfo
*
tbinfo
,
int
numTables
,
const
char
*
tablename
);
extern
const
char
*
fmtId
(
const
char
*
identifier
,
bool
force_quotes
);
#endif
/* PG_DUMP_H */
src/include/access/ibit.h
浏览文件 @
ecd0bfa8
...
...
@@ -6,19 +6,18 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: ibit.h,v 1.1
0 1999/07/15 23:03:34 momjian
Exp $
* $Id: ibit.h,v 1.1
1 1999/10/23 03:13:27 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef IBIT_H
#define IBIT_H
#include "
utils/memutils
.h"
#include "
catalog/pg_index
.h"
typedef
struct
IndexAttributeBitMapData
{
char
bits
[(
MaxIndexAttributeNumber
+
MaxBitsPerByte
-
1
)
/
MaxBitsPerByte
];
bits8
bits
[(
INDEX_MAX_KEYS
+
8
-
1
)
/
8
];
}
IndexAttributeBitMapData
;
typedef
IndexAttributeBitMapData
*
IndexAttributeBitMap
;
...
...
src/include/access/itup.h
浏览文件 @
ecd0bfa8
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: itup.h,v 1.2
1 1999/07/19 07:07:28 momjian
Exp $
* $Id: itup.h,v 1.2
2 1999/10/23 03:13:28 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -18,7 +18,6 @@
#include "access/tupmacs.h"
#include "storage/itemptr.h"
#define MaxIndexAttributeNumber 7
typedef
struct
IndexTupleData
{
...
...
src/include/libpq/hba.h
浏览文件 @
ecd0bfa8
...
...
@@ -4,7 +4,7 @@
* Interface to hba.c
*
*
* $Id: hba.h,v 1.1
5 1999/09/27 03:13:10 momjian
Exp $
* $Id: hba.h,v 1.1
6 1999/10/23 03:13:29 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -24,19 +24,10 @@
#define OLD_CONF_FILE "pg_hba"
/* Name of the config file in prior releases of Postgres. */
#define MAX_LINES 255
/* Maximum number of config lines that can apply to one database */
#define MAX_TOKEN 80
/* Maximum size of one token in the configuration file */
#define MAX_AUTH_ARG 80
/* Max size of an authentication arg */
#define IDENT_PORT 113
/* Standard TCP port number for Ident service. Assigned by IANA */
#define IDENT_USERNAME_MAX 512
/* Max size of username ident server can return */
#define MAX_AUTH_ARG 80
/* Max size of an authentication arg */
typedef
enum
UserAuth
{
...
...
src/include/libpq/libpq.h
浏览文件 @
ecd0bfa8
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: libpq.h,v 1.3
3 1999/08/31 04:26:33
tgl Exp $
* $Id: libpq.h,v 1.3
4 1999/10/23 03:13:29
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -135,15 +135,15 @@ extern Exception MemoryError,
ProtocolError
;
/*
* POSTGRES backend dependent Constants.
* PQerrormsg[] is used only for error messages generated within backend
* libpq, none of which are remarkably long. Note that this length should
* NOT be taken as any indication of the maximum error message length that
* the backend can create! elog() can in fact produce extremely long messages.
*/
/* ERROR_MSG_LENGTH should really be the same as ELOG_MAXLEN in utils/elog.h*/
#define ERROR_MSG_LENGTH 4096
#define COMMAND_LENGTH 20
#define REMARK_LENGTH 80
#define PQERRORMSG_LENGTH 1024
extern
char
PQerrormsg
[
ERROR_MSG_LENGTH
];
/* in porta
l.c */
extern
char
PQerrormsg
[
PQERRORMSG_LENGTH
];
/* in libpq/uti
l.c */
/*
* External functions.
...
...
src/include/miscadmin.h
浏览文件 @
ecd0bfa8
...
...
@@ -11,7 +11,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.4
4 1999/10/08 04:28:52 momjian
Exp $
* $Id: miscadmin.h,v 1.4
5 1999/10/23 03:13:30 tgl
Exp $
*
* NOTES
* some of the information in this file will be moved to
...
...
@@ -101,9 +101,6 @@ extern int SortMem;
extern
Oid
LastOidProcessed
;
/* for query rewrite */
/* #define MAX_QUERY_SIZE (BLCKSZ*2) */
#define MAX_PARSE_BUFFER MAX_QUERY_SIZE
/*****************************************************************************
* pdir.h -- *
* POSTGRES directory path definitions. *
...
...
src/include/postgres.h
浏览文件 @
ecd0bfa8
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1995, Regents of the University of California
*
* $Id: postgres.h,v 1.2
6 1999/07/17 04:12:10 momjian
Exp $
* $Id: postgres.h,v 1.2
7 1999/10/23 03:13:30 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -54,7 +54,7 @@ typedef double float8;
typedef
int4
aclitem
;
#define InvalidOid 0
#define OidIsValid(objectId) ((bool) (
objectId
!= InvalidOid))
#define OidIsValid(objectId) ((bool) (
(objectId)
!= InvalidOid))
/* unfortunately, both regproc and RegProcedure are used */
typedef
Oid
regproc
;
...
...
@@ -147,7 +147,7 @@ typedef uint32 CommandId;
/* ----------------------------------------------------------------
* Section 5: random stuff
* CSIGNBIT,
MAXPGPATH,
STATUS...
* CSIGNBIT, STATUS...
* ----------------------------------------------------------------
*/
...
...
@@ -158,12 +158,8 @@ typedef uint32 CommandId;
/* msb for char */
#define CSIGNBIT (0x80)
/* ----------------
* global variables which should probably go someplace else.
* ----------------
*/
/* this should probably be somewhere else */
#define MAXPGPATH 128
#define MAX_QUERY_SIZE (BLCKSZ*2)
#define STATUS_OK (0)
#define STATUS_ERROR (-1)
...
...
@@ -180,8 +176,7 @@ typedef uint32 CommandId;
* ---------------
*/
#ifdef CYR_RECODE
void
SetCharSet
();
extern
void
SetCharSet
();
#endif
/* CYR_RECODE */
#endif
/* POSTGRES_H */
src/include/tcop/fastpath.h
浏览文件 @
ecd0bfa8
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: fastpath.h,v 1.
5 1999/02/13 23:22:12 momjian
Exp $
* $Id: fastpath.h,v 1.
6 1999/10/23 03:13:32 tgl
Exp $
*
* NOTES
* This information pulled out of tcop/fastpath.c and put
...
...
@@ -24,7 +24,6 @@
*/
#define VAR_LENGTH_RESULT (-1)
#define VAR_LENGTH_ARG (-5)
#define MAX_STRING_LENGTH 256
extern
int
HandleFunctionRequest
(
void
);
...
...
src/include/utils/memutils.h
浏览文件 @
ecd0bfa8
...
...
@@ -8,29 +8,17 @@
* align.h alignment macros
* aset.h memory allocation set stuff
* oset.h (used by aset.h)
* (bit.h bit array type / extern)
* clib.h mem routines
* limit.h max bits/byte, etc.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: memutils.h,v 1.31 1999/08/24 20:11:19 tgl Exp $
*
* NOTES
* some of the information in this file will be moved to
* other files, (like MaxHeapTupleSize and MaxAttributeSize).
* $Id: memutils.h,v 1.32 1999/10/23 03:13:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef MEMUTILS_H
#define MEMUTILS_H
/*
* This is not needed by this include file, but by almost every file
* that includes this file.
*/
/* ----------------
* Alignment macros: align a length or address appropriately for a given type.
*
...
...
@@ -236,40 +224,5 @@ extern AllocPointer AllocSetRealloc(AllocSet set, AllocPointer pointer,
extern
void
AllocSetDump
(
AllocSet
set
);
/*****************************************************************************
* clib.h -- Standard C library definitions *
*****************************************************************************/
/*
* Note:
* This file is OPERATING SYSTEM dependent!!!
*
*/
/*
* LibCCopyLength is only used within this file. -cim 6/12/90
*
*/
typedef
int
LibCCopyLength
;
/*
* MemoryCopy
* Copies fixed length block of memory to another.
*/
#define MemoryCopy(toBuffer, fromBuffer, length)\
memcpy(toBuffer, fromBuffer, length)
/*****************************************************************************
* limit.h -- POSTGRES limit definitions. *
*****************************************************************************/
#define MaxBitsPerByte 8
typedef
uint32
AttributeSize
;
/* XXX should be defined elsewhere */
#define MaxHeapTupleSize 0x7fffffff
#define MaxAttributeSize 0x7fffffff
#define MaxIndexAttributeNumber 7
#endif
/* MEMUTILS_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录