Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
b7c37844
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,发现更多精彩内容 >>
提交
b7c37844
编写于
11月 30, 2000
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Repair residual sillinesses from UUNET virtual host/socket path patch.
I hope all the dust has settled out now ...
上级
73d0514d
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
111 addition
and
117 deletion
+111
-117
doc/src/sgml/environ.sgml
doc/src/sgml/environ.sgml
+11
-12
doc/src/sgml/libpq++.sgml
doc/src/sgml/libpq++.sgml
+7
-13
doc/src/sgml/libpq.sgml
doc/src/sgml/libpq.sgml
+13
-9
doc/src/sgml/ref/pg_dump.sgml
doc/src/sgml/ref/pg_dump.sgml
+4
-3
doc/src/sgml/ref/pg_dumpall.sgml
doc/src/sgml/ref/pg_dumpall.sgml
+4
-2
doc/src/sgml/ref/pg_restore.sgml
doc/src/sgml/ref/pg_restore.sgml
+3
-2
doc/src/sgml/ref/postmaster.sgml
doc/src/sgml/ref/postmaster.sgml
+12
-16
doc/src/sgml/runtime.sgml
doc/src/sgml/runtime.sgml
+14
-26
doc/src/sgml/start.sgml
doc/src/sgml/start.sgml
+8
-8
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+2
-3
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+33
-23
未找到文件。
doc/src/sgml/environ.sgml
浏览文件 @
b7c37844
...
...
@@ -47,17 +47,16 @@ $ export PATH
</Para>
<Para>
If your site administrator has not set things up in the default way,
you may have some more work to do. For example, if the database server
machine is a remote machine, you will need to set the
<Acronym>PGHOST</Acronym> environment variable to the name of the
database server machine. The environment variable
<Acronym>PGPORT</Acronym> or <envar>PGUNIXSOCKET</envar> may also have
to be set. The bottom line is this: if you try to start an application
program and it complains that it cannot connect to the
<Application>postmaster</Application>, you should immediately consult
your site administrator to make sure that your environment is properly
set up. </Para>
If your site administrator has not set things up in the
default way, you may have some more work to do. For example, if the database
server machine is a remote machine, you
will need to set the <Acronym>PGHOST</Acronym> environment variable to the name
of the database server machine. The environment variable
<Acronym>PGPORT</Acronym> may also have to be set. The bottom line is this: if
you try to start an application program and it complains
that it cannot connect to the <Application>postmaster</Application>,
you should immediately consult your site administrator to make sure that your
environment is properly set up.
</Para>
</Chapter>
doc/src/sgml/libpq++.sgml
浏览文件 @
b7c37844
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.
19 2000/11/22 01:41:12 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.
20 2000/11/30 23:20:50 tgl
Exp $
-->
<chapter id="libpqplusplus">
...
...
@@ -80,22 +80,16 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.19 2000/11/22 01:41:
<listitem>
<para>
<envar>PGHOST</envar> sets the default server name.
If it begins with a slash, it is used
as the directory for the unix domain socket.
If this begins with a slash, it specifies Unix-domain communication
rather than TCP/IP communication; the value is the name of the
directory in which the socket file is stored (default "/tmp").
</para>
</listitem>
<listitem>
<para>
<envar>PGPORT</envar> sets the default port or local Unix domain socket
file extension for communicating with the <productname>Postgres</productname>
backend.
</para>
</listitem>
<listitem>
<para>
<envar>PGUNIXSOCKET</envar> sets the Unix domain socket
directory for communicating with the <productname>Postgres</productname>
backend.
<envar>PGPORT</envar> sets the default TCP port number or Unix-domain
socket file extension for communicating with the
<productname>Postgres</productname> backend.
</para>
</listitem>
<listitem>
...
...
doc/src/sgml/libpq.sgml
浏览文件 @
b7c37844
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.5
0 2000/11/30 18:34:36 petere
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.5
1 2000/11/30 23:20:50 tgl
Exp $
-->
<chapter id="libpq-chapter">
...
...
@@ -88,9 +88,11 @@ PGconn *PQconnectdb(const char *conninfo)
<listitem>
<para>
Name of host to connect to.
Using this parameter causes a hostname look-up. See hostaddr.
If it begins with a slash, it is used
as the directory for the unix domain socket.
If this begins with a slash, it specifies Unix-domain communication
rather than TCP/IP communication; the value is the name of the
directory in which the socket file is stored.
The default is to connect to a Unix-domain socket in
<filename>/tmp</filename>.
</para>
</listitem>
</varlistentry>
...
...
@@ -118,7 +120,7 @@ PGconn *PQconnectdb(const char *conninfo)
machine at hostaddr.
</para>
<para>
Without
both a host name and
host address, libpq will connect using a
Without
either a host name or
host address, libpq will connect using a
local Unix domain socket.
</para>
</listitem>
...
...
@@ -1820,14 +1822,16 @@ application programs.
<listitem>
<para>
<envar>PGHOST</envar> sets the default server name.
If it beings with a slash, it is used as the directory for the unix domain
socket.
If this begins with a slash, it specifies Unix-domain communication
rather than TCP/IP communication; the value is the name of the
directory in which the socket file is stored (default "/tmp").
</para>
</listitem>
<listitem>
<para>
<envar>PGPORT</envar> sets the default port for communicating with
the <productname>Postgres</productname> backend.
<envar>PGPORT</envar> sets the default TCP port number or Unix-domain
socket file extension for communicating with the
<productname>Postgres</productname> backend.
</para>
</listitem>
<listitem>
...
...
doc/src/sgml/ref/pg_dump.sgml
浏览文件 @
b7c37844
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.2
5 2000/11/22 01:41:13 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.2
6 2000/11/30 23:20:50 tgl
Exp $
Postgres documentation
-->
...
...
@@ -371,8 +371,9 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ]
<varlistentry>
<term><computeroutput>
Connection to database 'template1' failed.
connectDB() failed: Is the postmaster running and accepting connections
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
connectDBStart() -- connect() failed: No such file or directory
Is the postmaster running locally
and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
</computeroutput></term>
<listitem>
<para>
...
...
doc/src/sgml/ref/pg_dumpall.sgml
浏览文件 @
b7c37844
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.1
5 2000/11/22 01:41:13 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.1
6 2000/11/30 23:20:50 tgl
Exp $
Postgres documentation
-->
...
...
@@ -192,7 +192,9 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
<varlistentry>
<term><computeroutput>
Connection to database 'template1' failed.
connectDB() failed: Is the postmaster running and accepting connections at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
connectDBStart() -- connect() failed: No such file or directory
Is the postmaster running locally
and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
</computeroutput></term>
<listitem>
<para>
...
...
doc/src/sgml/ref/pg_restore.sgml
浏览文件 @
b7c37844
...
...
@@ -345,8 +345,9 @@ pg_restore [ <replaceable class="parameter">archive-file</replaceable> ]
<varlistentry>
<term><computeroutput>
Connection to database 'template1' failed.
connectDB() failed: Is the postmaster running and accepting connections
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
connectDBStart() -- connect() failed: No such file or directory
Is the postmaster running locally
and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
</computeroutput></term>
<listitem>
<para>
...
...
doc/src/sgml/ref/postmaster.sgml
浏览文件 @
b7c37844
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.1
7 2000/11/28 23:27:54
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.1
8 2000/11/30 23:20:50
tgl Exp $
Postgres documentation
-->
<refentry id="APP-POSTMASTER">
<docinfo>
<date>2000-11-
12
</date>
<date>2000-11-
30
</date>
</docinfo>
<refmeta>
...
...
@@ -30,7 +30,7 @@ Postgres documentation
<arg>-F</arg>
<arg>-h <replaceable>hostname</replaceable></arg>
<arg>-i</arg>
<arg>-k <replaceable>
filename
</replaceable></arg>
<arg>-k <replaceable>
directory
</replaceable></arg>
<arg>-l</arg>
<arg>-N <replaceable>max-connections</replaceable></arg>
<arg>-o <replaceable>extra-options</replaceable></arg>
...
...
@@ -70,10 +70,10 @@ Postgres documentation
starts it needs to know the location of the database cluster files
(<quote>data area</quote>). This is done with the
<option>-D</option> invocation option or the <envar>PGDATA</envar>
environment variable
,
there is no default. More than one
environment variable
;
there is no default. More than one
postmaster process can run on a system at one time, as long as they
use different data areas and different
port numbers (see below). A
data area is created with <xref linkend="app-initdb"
use different data areas and different
communication ports (see below).
A
data area is created with <xref linkend="app-initdb"
endterm="app-initdb-title">.
</para>
...
...
@@ -165,10 +165,8 @@ Postgres documentation
<para>
Specifies the TCP/IP hostname or address on which the
<application>postmaster</application> is to listen for
connections from client applications. Defaults to the value
of the <envar>PGHOST</envar> environment variable, or if
<envar>PGHOST</envar> is not set, it defaults to listening on
all configured addresses (including localhost).
connections from client applications. Defaults to
listening on all configured addresses (including localhost).
</para>
</listitem>
</varlistentry>
...
...
@@ -185,15 +183,13 @@ Postgres documentation
</varlistentry>
<varlistentry>
<term>-k <replaceable class="parameter">
file
name</replaceable></term>
<term>-k <replaceable class="parameter">
directory
name</replaceable></term>
<listitem>
<para>
Specifies the directory
for Unix
domain socket on which the
Specifies the directory
of the Unix-
domain socket on which the
<application>postmaster</application> is to listen for
connections from client applications. Defaults to the value
of the <envar>PGUNIXSOCKET</envar> environment variable, or if
<envar>PGUNIXSOCKET</envar> is not set, then defaults to a
file in <filename>/tmp</filename>.
connections from client applications. The default is normally
<filename>/tmp</filename>, but can be changed at build time.
</para>
</listitem>
</varlistentry>
...
...
doc/src/sgml/runtime.sgml
浏览文件 @
b7c37844
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.
39 2000/11/25 20:33:47
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.
40 2000/11/30 23:20:50
tgl Exp $
-->
<Chapter Id="runtime">
...
...
@@ -347,7 +347,7 @@ IpcSemaphoreCreate: semget(key=5440026, num=16, 01600) failed: No space left on
<para>
<screen>
connectDB() -- connect() failed: Connection refused
Is the postmaster running (with -i) at 'server.joe.com' and accepting connections on TCP/IP port
'5432'
?
Is the postmaster running (with -i) at 'server.joe.com' and accepting connections on TCP/IP port
5432
?
</screen>
This is the generic <quote>I couldn't find a server to talk
to</quote> failure. It looks like the above when TCP/IP
...
...
@@ -361,7 +361,7 @@ Is the postmaster running (with -i) at 'server.joe.com' and accepting connection
Unix-socket communication to a local postmaster:
<screen>
connectDB() -- connect() failed: No such file or directory
Is the postmaster running
at 'localhost' and accepting connections on Unix socket '
5432'?
Is the postmaster running
locally and accepting connections on Unix socket '/tmp/.s.PGSQL.
5432'?
</screen>
</para>
...
...
@@ -1082,15 +1082,13 @@ env PGOPTIONS='-c geqo=off' psql
</varlistentry>
<varlistentry>
<term>UNIX
SOCKET
(<type>string</type>)</term>
<term>UNIX
_SOCKET_DIRECTORY
(<type>string</type>)</term>
<listitem>
<para>
Specifies the directory of the Unix
domain socket on which the
Specifies the directory of the Unix
-
domain socket on which the
<application>postmaster</application> is to listen for
connections from client applications. Defaults to the value
of the <envar>PGUNIXSOCKET</envar> environment variable, or if
<envar>PGUNIXSOCKET</envar> is not set, then defaults to
<filename>/tmp</filename>.
connections from client applications. The default is normally
<filename>/tmp</filename>, but can be changed at build time.
</para>
</listitem>
</varlistentry>
...
...
@@ -1151,23 +1149,8 @@ env PGOPTIONS='-c geqo=off' psql
<para>
Specifies the TCP/IP hostname or address on which the
<application>postmaster</application> is to listen for
connections from client applications. Defaults to the value
of the <envar>PGHOST</envar> environment variable, or if
<envar>PGHOST</envar> is not set, it defaults to listening on
all configured addresses (including localhost).
</para>
<para>
If you use a hostname do not try to run multiple instances of
<application>postmaster</application> on the same IP address
but different ports. Doing so will result in them attempting
(incorrectly) to use the same shared memory segments. Also,
if you use a hostname, all of the host's IP addresses on which
<application>postmaster</application> instances are listening
must be distinct in the two last octets.
</para>
<para>
If you do not use this option, then each instance must listen
on a different port.
connections from client applications. Defaults to
listening on all configured addresses (including localhost).
</para>
</listitem>
</varlistentry>
...
...
@@ -1220,6 +1203,11 @@ env PGOPTIONS='-c geqo=off' psql
<entry>tcpip_socket = on</entry>
<entry></entry>
</row>
<row>
<entry>-k <replaceable>x</replaceable></entry>
<entry>unix_socket_directory = <replaceable>x</replaceable></entry>
<entry></entry>
</row>
<row>
<entry>-l</entry>
<entry>ssl = on</entry>
...
...
doc/src/sgml/start.sgml
浏览文件 @
b7c37844
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/start.sgml,v 1.1
4 2000/11/13 15:18:07 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/start.sgml,v 1.1
5 2000/11/30 23:20:50 tgl
Exp $
-->
<chapter id="start">
...
...
@@ -110,7 +110,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/start.sgml,v 1.14 2000/11/13 15:18:07 momji
will need to set the <acronym>PGHOST</acronym> environment
variable to the name
of the database server machine. The environment variable
<acronym>PGPORT</acronym>
or <acronym>PGUNIXSOCKET</acronym>
may also have to be set.
<acronym>PGPORT</acronym> may also have to be set.
The bottom line is this: if
you try to start an application program and it complains
that it cannot connect to the <application>postmaster</application>,
...
...
@@ -154,18 +154,18 @@ $Header: /cvsroot/pgsql/doc/src/sgml/start.sgml,v 1.14 2000/11/13 15:18:07 momji
<programlisting>
% psql template1
Connection to database 'postgres' failed.
connectDB() failed: Is the postmaster running and accepting connections
at 'UNIX Socket' on port '
5432'?
psql: connectDBStart() -- connect() failed: No such file or directory
Is the postmaster running locally
and accepting connections on Unix socket '/tmp/.s.PGSQL.
5432'?
</programlisting>
or
<programlisting>
% psql -h localhost template1
Connection to database 'postgres' failed.
connectDB() failed: Is the postmaster running and accepting TCP/IP
(with -i) connections at 'localhost' on port '5432'
?
psql: PQconnectPoll() -- connect() failed: Connection refused
Is the postmaster running (with -i) at 'localhost'
and accepting connections on TCP/IP port 5432
?
</programlisting>
it is usually because
...
...
src/backend/postmaster/postmaster.c
浏览文件 @
b7c37844
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.19
6 2000/11/29 22:04:04
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.19
7 2000/11/30 23:20:51
tgl Exp $
*
* NOTES
*
...
...
@@ -432,7 +432,6 @@ PostmasterMain(int argc, char *argv[])
NetServer
=
true
;
break
;
case
'k'
:
/* Set PGUNIXSOCKET by hand. */
UnixSocketDir
=
optarg
;
break
;
#ifdef USE_SSL
...
...
@@ -732,7 +731,7 @@ usage(const char *progname)
printf
(
" -F turn fsync off
\n
"
);
printf
(
" -h HOSTNAME host name or IP address to listen on
\n
"
);
printf
(
" -i enable TCP/IP connections
\n
"
);
printf
(
" -k
FILENAME Unix
domain socket location
\n
"
);
printf
(
" -k
DIRECTORY Unix-
domain socket location
\n
"
);
#ifdef USE_SSL
printf
(
" -l enable SSL connections
\n
"
);
#endif
...
...
src/interfaces/libpq/fe-connect.c
浏览文件 @
b7c37844
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.15
1 2000/11/30 18:32:52 petere
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.15
2 2000/11/30 23:20:51 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -741,6 +741,36 @@ connectNoDelay(PGconn *conn)
}
/* ----------
* connectFailureMessage -
* create a friendly error message on connection failure.
* ----------
*/
static
void
connectFailureMessage
(
PGconn
*
conn
,
const
char
*
caller
,
int
errorno
)
{
#ifdef HAVE_UNIX_SOCKETS
if
(
conn
->
raddr
.
sa
.
sa_family
==
AF_UNIX
)
printfPQExpBuffer
(
&
conn
->
errorMessage
,
"%s -- connect() failed: %s
\n
"
"
\t
Is the postmaster running locally
\n
"
"
\t
and accepting connections on Unix socket '%s'?
\n
"
,
caller
,
strerror
(
errorno
),
conn
->
raddr
.
un
.
sun_path
);
else
#endif
printfPQExpBuffer
(
&
conn
->
errorMessage
,
"%s -- connect() failed: %s
\n
"
"
\t
Is the postmaster running (with -i) at '%s'
\n
"
"
\t
and accepting connections on TCP/IP port %s?
\n
"
,
caller
,
strerror
(
errorno
),
conn
->
pghost
?
conn
->
pghost
:
"localhost"
,
conn
->
pgport
);
}
/* ----------
* connectDBStart -
* Start to make a connection to the backend so it is ready to receive
...
...
@@ -911,17 +941,7 @@ connectDBStart(PGconn *conn)
else
{
/* Something's gone wrong */
printfPQExpBuffer
(
&
conn
->
errorMessage
,
"connectDBStart() -- connect() failed: %s
\n
"
"
\t
Is the postmaster running%s at '%s'
\n
"
"
\t
and accepting connections on %s '%s'?
\n
"
,
strerror
(
errno
),
(
family
==
AF_INET
)
?
" (with -i)"
:
""
,
conn
->
pghost
?
conn
->
pghost
:
"localhost"
,
(
family
==
AF_INET
)
?
"TCP/IP port"
:
"Unix socket"
,
(
family
==
AF_UNIX
&&
conn
->
pgunixsocket
)
?
conn
->
pgunixsocket
:
conn
->
pgport
);
connectFailureMessage
(
conn
,
"connectDBStart()"
,
errno
);
goto
connect_errReturn
;
}
}
...
...
@@ -1213,17 +1233,7 @@ keep_going: /* We will come back to here until there
* see connect failures at this point, so provide a
* friendly error message.
*/
printfPQExpBuffer
(
&
conn
->
errorMessage
,
"PQconnectPoll() -- connect() failed: %s
\n
"
"
\t
Is the postmaster running%s at '%s'
\n
"
"
\t
and accepting connections on %s '%s'?
\n
"
,
strerror
(
optval
),
(
conn
->
raddr
.
sa
.
sa_family
==
AF_INET
)
?
" (with -i)"
:
""
,
conn
->
pghost
?
conn
->
pghost
:
"localhost"
,
(
conn
->
raddr
.
sa
.
sa_family
==
AF_INET
)
?
"TCP/IP port"
:
"Unix socket"
,
(
conn
->
raddr
.
sa
.
sa_family
==
AF_UNIX
&&
conn
->
pgunixsocket
)
?
conn
->
pgunixsocket
:
conn
->
pgport
);
connectFailureMessage
(
conn
,
"PQconnectPoll()"
,
optval
);
goto
error_return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录