mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Replace the virtual_host and tcpip_socket parameters with a unified
listen_addresses parameter, as per recent discussion. The default behavior is now to listen on localhost, which eliminates the need for the -i postmaster switch in many scenarios. Andrew Dunstan
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
PostgreSQL on QNX 4
|
PostgreSQL on QNX 4
|
||||||
--------------------
|
--------------------
|
||||||
last updated: $Date: 2002/07/09 04:47:07 $
|
last updated: $Date: 2004/03/23 01:23:47 $
|
||||||
|
|
||||||
current maintainer: Bernd Tegge (tegge@repas-aeg.de)
|
current maintainer: Bernd Tegge (tegge@repas-aeg.de)
|
||||||
original author: Andreas Kardos (kardos@repas-aeg.de)
|
original author: Andreas Kardos (kardos@repas-aeg.de)
|
||||||
@ -23,10 +23,9 @@ functionality cannot be used. Shared library support could probably be
|
|||||||
implemented in future.
|
implemented in future.
|
||||||
|
|
||||||
QNX 4 does not support UNIX domain sockets. Clients must use TCP/IP
|
QNX 4 does not support UNIX domain sockets. Clients must use TCP/IP
|
||||||
sockets. Therefore you either have to set "tcpip_socket = true" in
|
sockets. Therefore, do not set "listen_addresses" to empty in your
|
||||||
your postgresql.conf or to start postmaster with the -i option.
|
postgresql.conf file. In fact, it's advisable to explicitly set
|
||||||
Furthermore it's advisable to set to set the PGHOST or SOCK environment
|
"listen_addresses" in an environment using native QNX networking.
|
||||||
variable for postmaster in an environment using native QNX networking.
|
|
||||||
Otherwise the postmaster might not use the IP-Address you think it does :-)
|
Otherwise the postmaster might not use the IP-Address you think it does :-)
|
||||||
|
|
||||||
Prerequisites:
|
Prerequisites:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.64 2004/03/09 16:57:46 neilc Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.65 2004/03/23 01:23:48 tgl Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="client-authentication">
|
<chapter id="client-authentication">
|
||||||
@ -112,13 +112,19 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This record matches connection attempts made using TCP/IP.
|
This record matches connection attempts made using TCP/IP.
|
||||||
Note that TCP/IP connections are disabled unless the server is
|
<literal>host</literal> records match either
|
||||||
started with the <option>-i</option> option or the <xref
|
|
||||||
linkend="guc-tcpip-socket"> configuration parameter is
|
|
||||||
enabled. <literal>host</literal> records match either
|
|
||||||
<acronym>SSL</acronym> or non-<acronym>SSL</acronym> connection
|
<acronym>SSL</acronym> or non-<acronym>SSL</acronym> connection
|
||||||
attempts.
|
attempts.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
Remote TCP/IP connections will not be possible unless
|
||||||
|
the server is started with an appropriate value for the
|
||||||
|
<xref linkend="guc-listen-addresses"> configuration parameter,
|
||||||
|
since the default behavior is to listen for TCP/IP connections
|
||||||
|
only on the local loopback address <literal>localhost</>.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@ -126,17 +132,17 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
|
|||||||
<term><literal>hostssl</literal></term>
|
<term><literal>hostssl</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This record matches connection attempts made using TCP/IP. In
|
This record matches connection attempts made using TCP/IP,
|
||||||
addition, this record requires that the connection is made with
|
but only when the connection is made with <acronym>SSL</acronym>
|
||||||
<acronym>SSL</acronym>.
|
encryption.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To make use of this option the server must be built with
|
To make use of this option the server must be built with
|
||||||
<acronym>SSL</acronym> support enabled. Furthermore,
|
<acronym>SSL</acronym> support. Furthermore,
|
||||||
<acronym>SSL</acronym> must be enabled by setting the <xref
|
<acronym>SSL</acronym> must be enabled at server start time
|
||||||
linkend="guc-ssl"> configuration parameter (see <xref
|
by setting the <xref linkend="guc-ssl"> configuration parameter (see
|
||||||
linkend="ssl-tcp"> for more information).
|
<xref linkend="ssl-tcp"> for more information).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -146,8 +152,8 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This record is similar to <literal>hostssl</> but with the
|
This record is similar to <literal>hostssl</> but with the
|
||||||
opposite logic: it only matches connection attempts made over
|
opposite logic: it only matches connection attempts made over
|
||||||
TCP/IP that do not use <acronym>SSL</acronym>.
|
TCP/IP that do not use <acronym>SSL</acronym>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.46 2004/03/09 16:57:47 neilc Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.47 2004/03/23 01:23:48 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -165,11 +165,17 @@ PostgreSQL documentation
|
|||||||
<term><option>-h <replaceable class="parameter">hostname</replaceable></option></term>
|
<term><option>-h <replaceable class="parameter">hostname</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the IP host name or address on which the
|
Specifies the IP host name or address on which the
|
||||||
<command>postmaster</command> is to listen for
|
<command>postmaster</command> is to listen for TCP/IP
|
||||||
connections from client applications. Defaults to
|
connections from client applications. The value can also be
|
||||||
listening on all configured addresses (including
|
a space-separated list of addresses, or <literal>*</> to specify
|
||||||
<systemitem class="systemname">localhost</systemitem>).
|
listening on all available interfaces. An empty value specifies
|
||||||
|
not listening on any IP addresses, in which case only Unix-domain
|
||||||
|
sockets can be used to connect to the <command>postmaster</command>.
|
||||||
|
Defaults to listening only
|
||||||
|
on <systemitem class="systemname">localhost</systemitem>.
|
||||||
|
This option is equivalent to setting <literal>listen_addresses</> in
|
||||||
|
<filename>postgresql.conf</>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -178,14 +184,16 @@ PostgreSQL documentation
|
|||||||
<term><option>-i</option></term>
|
<term><option>-i</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allows clients to connect via TCP/IP (Internet domain)
|
Allows remote clients to connect via TCP/IP (Internet domain)
|
||||||
connections. Without this option, only local Unix domain
|
connections. Without this option, only local connections are
|
||||||
socket connections are accepted. This option corresponds
|
accepted. This option is equivalent to setting
|
||||||
to setting <literal>tcpip_socket=true</> in <filename>postgresql.conf</>.
|
<literal>listen_addresses</> to <literal>*</> in
|
||||||
|
<filename>postgresql.conf</> or via <option>-h</>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
<option>--tcpip-socket=false</option> has the opposite
|
This option is deprecated since it does not allow access to the
|
||||||
effect of this option.
|
full functionality of <literal>listen_addresses</>. It's usually
|
||||||
|
better to set <literal>listen_addresses</> directly.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -206,8 +214,7 @@ PostgreSQL documentation
|
|||||||
<term><option>-l</option></term>
|
<term><option>-l</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Enables secure connections using SSL. The <option>-i</option>
|
Enables secure connections using SSL. You must have compiled with SSL
|
||||||
option is also required. You must have compiled with SSL
|
|
||||||
enabled to use this option.
|
enabled to use this option.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.251 2004/03/15 17:57:51 momjian Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.252 2004/03/23 01:23:48 tgl Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<Chapter Id="runtime">
|
<Chapter Id="runtime">
|
||||||
@ -186,11 +186,7 @@ $ <userinput>postmaster -D /usr/local/pgsql/data >logfile 2>&1 &</
|
|||||||
<para>
|
<para>
|
||||||
The <command>postmaster</command> also takes a number of other
|
The <command>postmaster</command> also takes a number of other
|
||||||
command line options. For more information, see the reference page
|
command line options. For more information, see the reference page
|
||||||
and <xref linkend="runtime-config"> below. In particular, in order
|
and <xref linkend="runtime-config"> below.
|
||||||
for the server to accept
|
|
||||||
TCP/IP<indexterm><primary>TCP/IP</primary></indexterm> connections
|
|
||||||
(rather than just Unix-domain socket ones), you must specify the
|
|
||||||
<option>-i</option> option.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -333,7 +329,7 @@ FATAL: could not create TCP/IP listen socket
|
|||||||
be a different problem. For example, trying to start a <command>postmaster</command>
|
be a different problem. For example, trying to start a <command>postmaster</command>
|
||||||
on a reserved port number may draw something like:
|
on a reserved port number may draw something like:
|
||||||
<screen>
|
<screen>
|
||||||
$ <userinput>postmaster -i -p 666</userinput>
|
$ <userinput>postmaster -p 666</userinput>
|
||||||
LOG: could not bind IPv4 socket: Permission denied
|
LOG: could not bind IPv4 socket: Permission denied
|
||||||
HINT: Is another postmaster already running on port 666? If not, wait a few seconds and retry.
|
HINT: Is another postmaster already running on port 666? If not, wait a few seconds and retry.
|
||||||
FATAL: could not create TCP/IP listen socket
|
FATAL: could not create TCP/IP listen socket
|
||||||
@ -570,19 +566,38 @@ SET ENABLE_SEQSCAN TO OFF;
|
|||||||
<title>Connection Settings</title>
|
<title>Connection Settings</title>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
|
|
||||||
<varlistentry id="guc-tcpip-socket" xreflabel="tcpip_socket">
|
<varlistentry id="guc-listen-addresses" xreflabel="listen_addresses">
|
||||||
<term><varname>tcpip_socket</varname> (<type>boolean</type>)</term>
|
<term><varname>listen_addresses</varname> (<type>string</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If this is true, then the server will accept TCP/IP connections.<indexterm><primary>TCP/IP</></>
|
Specifies the TCP/IP address(es) on which the server is
|
||||||
Otherwise only local Unix domain socket connections are
|
to listen for connections from client applications.
|
||||||
accepted. It is off by default. This option can only be set at
|
The value takes the form of a space-separated list of host names
|
||||||
server start.
|
and/or numeric IP addresses. The special entry <literal>*</>
|
||||||
|
corresponds to all available IP interfaces.
|
||||||
|
If the list is empty, the server does not listen on any IP interface
|
||||||
|
at all, in which case only Unix-domain sockets can be used to connect
|
||||||
|
to it.
|
||||||
|
The default value is <systemitem class="systemname">localhost</>,
|
||||||
|
which allows only local <quote>loopback</> connections to be made.
|
||||||
|
This parameter can only be set at server start.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry id="guc-port" xreflabel="port">
|
||||||
|
<term><varname>port</varname> (<type>integer</type>)</term>
|
||||||
|
<indexterm><primary>port</></>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The TCP port the server listens on; 5432 by default. Note that the
|
||||||
|
same port number is used for all IP addresses the server listens on.
|
||||||
|
This parameter can only be set at server start.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="guc-max-connections" xreflabel="max_connections">
|
<varlistentry id="guc-max-connections" xreflabel="max_connections">
|
||||||
<term><varname>max_connections</varname> (<type>integer</type>)</term>
|
<term><varname>max_connections</varname> (<type>integer</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
@ -628,17 +643,6 @@ SET ENABLE_SEQSCAN TO OFF;
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="guc-port" xreflabel="port">
|
|
||||||
<term><varname>port</varname> (<type>integer</type>)</term>
|
|
||||||
<indexterm><primary>port</></>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The TCP port the server listens on; 5432 by default. This
|
|
||||||
option can only be set at server start.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
|
|
||||||
<varlistentry id="guc-unix-socket-directory" xreflabel="unix_socket_directory">
|
<varlistentry id="guc-unix-socket-directory" xreflabel="unix_socket_directory">
|
||||||
<term><varname>unix_socket_directory</varname> (<type>string</type>)</term>
|
<term><varname>unix_socket_directory</varname> (<type>string</type>)</term>
|
||||||
@ -648,6 +652,7 @@ SET ENABLE_SEQSCAN TO OFF;
|
|||||||
server is to listen for
|
server is to listen for
|
||||||
connections from client applications. The default is normally
|
connections from client applications. The default is normally
|
||||||
<filename>/tmp</filename>, but can be changed at build time.
|
<filename>/tmp</filename>, but can be changed at build time.
|
||||||
|
This parameter can only be set at server start.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -701,27 +706,15 @@ SET ENABLE_SEQSCAN TO OFF;
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="guc-virtual-host" xreflabel="virtual_host">
|
|
||||||
<term><varname>virtual_host</varname> (<type>string</type>)</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the IP address(es) on which the server is
|
|
||||||
to listen for connections from client applications. If specified,
|
|
||||||
it takes the form of a space-separated list of host names and/or
|
|
||||||
numeric IP addresses. If the list is empty, the server listens
|
|
||||||
on all available addresses (including
|
|
||||||
<systemitem class="systemname">localhost</>).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry id="guc-rendezvous-name" xreflabel="rendezvous_name">
|
<varlistentry id="guc-rendezvous-name" xreflabel="rendezvous_name">
|
||||||
<term><varname>rendezvous_name</varname> (<type>string</type>)</term>
|
<term><varname>rendezvous_name</varname> (<type>string</type>)</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the Rendezvous broadcast name. By default, the
|
Specifies the Rendezvous broadcast name. By default, the
|
||||||
computer name is used, specified as ''.
|
computer name is used, specified as an empty string ''.
|
||||||
|
This option is only meaningful on platforms that support Rendezvous.
|
||||||
|
This option can only be set at server start.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -3009,11 +3002,11 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><option>-h <replaceable>x</replaceable></option></entry>
|
<entry><option>-h <replaceable>x</replaceable></option></entry>
|
||||||
<entry><literal>virtual_host = <replaceable>x</replaceable></></entry>
|
<entry><literal>listen_addresses = <replaceable>x</replaceable></></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><option>-i</option></entry>
|
<entry><option>-i</option></entry>
|
||||||
<entry><literal>tcpip_socket = on</></entry>
|
<entry><literal>listen_addresses = '*'</></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><option>-k <replaceable>x</replaceable></option></entry>
|
<entry><option>-k <replaceable>x</replaceable></option></entry>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.375 2004/03/15 16:18:42 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.376 2004/03/23 01:23:48 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -149,7 +149,7 @@ static Backend *ShmemBackendArray;
|
|||||||
/* The socket number we are listening for connections on */
|
/* The socket number we are listening for connections on */
|
||||||
int PostPortNumber;
|
int PostPortNumber;
|
||||||
char *UnixSocketDir;
|
char *UnixSocketDir;
|
||||||
char *VirtualHost;
|
char *ListenAddresses;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MaxBackends is the limit on the number of backends we can start.
|
* MaxBackends is the limit on the number of backends we can start.
|
||||||
@ -202,7 +202,6 @@ static bool Reinit = true;
|
|||||||
static int SendStop = false;
|
static int SendStop = false;
|
||||||
|
|
||||||
/* still more option variables */
|
/* still more option variables */
|
||||||
bool NetServer = false; /* listen on TCP/IP */
|
|
||||||
bool EnableSSL = false;
|
bool EnableSSL = false;
|
||||||
bool SilentMode = false; /* silent mode (-S) */
|
bool SilentMode = false; /* silent mode (-S) */
|
||||||
|
|
||||||
@ -513,10 +512,10 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV);
|
SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
SetConfigOption("virtual_host", optarg, PGC_POSTMASTER, PGC_S_ARGV);
|
SetConfigOption("listen_addresses", optarg, PGC_POSTMASTER, PGC_S_ARGV);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
SetConfigOption("tcpip_socket", "true", PGC_POSTMASTER, PGC_S_ARGV);
|
SetConfigOption("listen_addresses", "*", PGC_POSTMASTER, PGC_S_ARGV);
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
SetConfigOption("unix_socket_directory", optarg, PGC_POSTMASTER, PGC_S_ARGV);
|
SetConfigOption("unix_socket_directory", optarg, PGC_POSTMASTER, PGC_S_ARGV);
|
||||||
@ -704,11 +703,6 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
* Initialize SSL library, if specified.
|
* Initialize SSL library, if specified.
|
||||||
*/
|
*/
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
if (EnableSSL && !NetServer)
|
|
||||||
{
|
|
||||||
postmaster_error("TCP/IP connections must be enabled for SSL");
|
|
||||||
ExitPostmaster(1);
|
|
||||||
}
|
|
||||||
if (EnableSSL)
|
if (EnableSSL)
|
||||||
secure_initialize();
|
secure_initialize();
|
||||||
#endif
|
#endif
|
||||||
@ -753,68 +747,60 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
for (i = 0; i < MAXLISTEN; i++)
|
for (i = 0; i < MAXLISTEN; i++)
|
||||||
ListenSocket[i] = -1;
|
ListenSocket[i] = -1;
|
||||||
|
|
||||||
if (NetServer)
|
if (ListenAddresses)
|
||||||
{
|
{
|
||||||
if (VirtualHost && VirtualHost[0])
|
char *curhost,
|
||||||
{
|
*endptr;
|
||||||
char *curhost,
|
char c;
|
||||||
*endptr;
|
|
||||||
char c = 0;
|
|
||||||
|
|
||||||
curhost = VirtualHost;
|
curhost = ListenAddresses;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
while (*curhost == ' ') /* skip any extra spaces */
|
/* ignore whitespace */
|
||||||
curhost++;
|
while (isspace((unsigned char) *curhost))
|
||||||
if (*curhost == '\0')
|
curhost++;
|
||||||
break;
|
if (*curhost == '\0')
|
||||||
endptr = strchr(curhost, ' ');
|
break;
|
||||||
if (endptr)
|
endptr = curhost;
|
||||||
{
|
while (*endptr != '\0' && !isspace((unsigned char) *endptr))
|
||||||
c = *endptr;
|
endptr++;
|
||||||
*endptr = '\0';
|
c = *endptr;
|
||||||
}
|
*endptr = '\0';
|
||||||
|
if (strcmp(curhost,"*") == 0)
|
||||||
|
status = StreamServerPort(AF_UNSPEC, NULL,
|
||||||
|
(unsigned short) PostPortNumber,
|
||||||
|
UnixSocketDir,
|
||||||
|
ListenSocket, MAXLISTEN);
|
||||||
|
else
|
||||||
status = StreamServerPort(AF_UNSPEC, curhost,
|
status = StreamServerPort(AF_UNSPEC, curhost,
|
||||||
(unsigned short) PostPortNumber,
|
(unsigned short) PostPortNumber,
|
||||||
UnixSocketDir,
|
UnixSocketDir,
|
||||||
ListenSocket, MAXLISTEN);
|
ListenSocket, MAXLISTEN);
|
||||||
if (status != STATUS_OK)
|
|
||||||
ereport(FATAL,
|
|
||||||
(errmsg("could not create listen socket for \"%s\"",
|
|
||||||
curhost)));
|
|
||||||
if (endptr)
|
|
||||||
{
|
|
||||||
*endptr = c;
|
|
||||||
curhost = endptr + 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status = StreamServerPort(AF_UNSPEC, NULL,
|
|
||||||
(unsigned short) PostPortNumber,
|
|
||||||
UnixSocketDir,
|
|
||||||
ListenSocket, MAXLISTEN);
|
|
||||||
if (status != STATUS_OK)
|
if (status != STATUS_OK)
|
||||||
ereport(FATAL,
|
ereport(WARNING,
|
||||||
(errmsg("could not create TCP/IP listen socket")));
|
(errmsg("could not create listen socket for \"%s\"",
|
||||||
|
curhost)));
|
||||||
|
*endptr = c;
|
||||||
|
if (c != '\0')
|
||||||
|
curhost = endptr+1;
|
||||||
|
else
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_RENDEZVOUS
|
#ifdef USE_RENDEZVOUS
|
||||||
if (rendezvous_name != NULL)
|
/* Register for Rendezvous only if we opened TCP socket(s) */
|
||||||
{
|
if (ListenSocket[0] != -1 && rendezvous_name != NULL)
|
||||||
DNSServiceRegistrationCreate(rendezvous_name,
|
{
|
||||||
"_postgresql._tcp.",
|
DNSServiceRegistrationCreate(rendezvous_name,
|
||||||
"",
|
"_postgresql._tcp.",
|
||||||
htonl(PostPortNumber),
|
"",
|
||||||
"",
|
htonl(PostPortNumber),
|
||||||
(DNSServiceRegistrationReply) reg_reply,
|
"",
|
||||||
NULL);
|
(DNSServiceRegistrationReply) reg_reply,
|
||||||
}
|
NULL);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNIX_SOCKETS
|
#ifdef HAVE_UNIX_SOCKETS
|
||||||
status = StreamServerPort(AF_UNIX, NULL,
|
status = StreamServerPort(AF_UNIX, NULL,
|
||||||
@ -822,10 +808,17 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
UnixSocketDir,
|
UnixSocketDir,
|
||||||
ListenSocket, MAXLISTEN);
|
ListenSocket, MAXLISTEN);
|
||||||
if (status != STATUS_OK)
|
if (status != STATUS_OK)
|
||||||
ereport(FATAL,
|
ereport(WARNING,
|
||||||
(errmsg("could not create Unix-domain socket")));
|
(errmsg("could not create Unix-domain socket")));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check that we have some socket to listen on
|
||||||
|
*/
|
||||||
|
if (ListenSocket[0] == -1)
|
||||||
|
ereport(FATAL,
|
||||||
|
(errmsg("no socket configured to listen on")));
|
||||||
|
|
||||||
XLOGPathInit();
|
XLOGPathInit();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.191 2004/03/22 03:15:29 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.192 2004/03/23 01:23:48 tgl Exp $
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------
|
*--------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -443,14 +443,6 @@ static struct config_bool ConfigureNamesBool[] =
|
|||||||
&session_auth_is_superuser,
|
&session_auth_is_superuser,
|
||||||
false, NULL, NULL
|
false, NULL, NULL
|
||||||
},
|
},
|
||||||
{
|
|
||||||
{"tcpip_socket", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
|
|
||||||
gettext_noop("Makes the server accept TCP/IP connections."),
|
|
||||||
NULL
|
|
||||||
},
|
|
||||||
&NetServer,
|
|
||||||
false, NULL, NULL
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
{"ssl", PGC_POSTMASTER, CONN_AUTH_SECURITY,
|
{"ssl", PGC_POSTMASTER, CONN_AUTH_SECURITY,
|
||||||
gettext_noop("Enables SSL connections."),
|
gettext_noop("Enables SSL connections."),
|
||||||
@ -1711,12 +1703,12 @@ static struct config_string ConfigureNamesString[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
{"virtual_host", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
|
{"listen_addresses", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
|
||||||
gettext_noop("Sets the host name or IP address to listen to."),
|
gettext_noop("Sets the host name or IP addresses to listen to."),
|
||||||
NULL
|
NULL
|
||||||
},
|
},
|
||||||
&VirtualHost,
|
&ListenAddresses,
|
||||||
"", NULL, NULL
|
"localhost", NULL, NULL
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -27,17 +27,17 @@
|
|||||||
|
|
||||||
# - Connection Settings -
|
# - Connection Settings -
|
||||||
|
|
||||||
#tcpip_socket = false
|
#listen_addresses = 'localhost' # what IP interface(s) to listen on;
|
||||||
|
# defaults to localhost, '*' = any
|
||||||
|
#port = 5432
|
||||||
#max_connections = 100
|
#max_connections = 100
|
||||||
# note: increasing max_connections costs about 500 bytes of shared
|
# note: increasing max_connections costs about 500 bytes of shared
|
||||||
# memory per connection slot, in addition to costs from shared_buffers
|
# memory per connection slot, in addition to costs from shared_buffers
|
||||||
# and max_locks_per_transaction.
|
# and max_locks_per_transaction.
|
||||||
#superuser_reserved_connections = 2
|
#superuser_reserved_connections = 2
|
||||||
#port = 5432
|
|
||||||
#unix_socket_directory = ''
|
#unix_socket_directory = ''
|
||||||
#unix_socket_group = ''
|
#unix_socket_group = ''
|
||||||
#unix_socket_permissions = 0777 # octal
|
#unix_socket_permissions = 0777 # octal
|
||||||
#virtual_host = '' # what interface to listen on; defaults to any
|
|
||||||
#rendezvous_name = '' # defaults to the computer name
|
#rendezvous_name = '' # defaults to the computer name
|
||||||
|
|
||||||
# - Security & Authentication -
|
# - Security & Authentication -
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.101 2004/02/03 17:34:03 tgl Exp $
|
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.102 2004/03/23 01:23:48 tgl Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
@ -560,7 +560,6 @@ psql_completion(char *text, int start, int end)
|
|||||||
"syslog",
|
"syslog",
|
||||||
"syslog_facility",
|
"syslog_facility",
|
||||||
"syslog_ident",
|
"syslog_ident",
|
||||||
"tcpip_socket",
|
|
||||||
"TimeZone",
|
"TimeZone",
|
||||||
"trace_notify",
|
"trace_notify",
|
||||||
"transform_null_equals",
|
"transform_null_equals",
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.153 2004/02/10 03:42:45 tgl Exp $
|
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.154 2004/03/23 01:23:48 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* some of the information in this file should be moved to
|
* some of the information in this file should be moved to
|
||||||
@ -212,7 +212,6 @@ extern bool VacuumCostActive;
|
|||||||
* A few postmaster startup options are exported here so the
|
* A few postmaster startup options are exported here so the
|
||||||
* configuration file processor can access them.
|
* configuration file processor can access them.
|
||||||
*/
|
*/
|
||||||
extern bool NetServer;
|
|
||||||
extern bool EnableSSL;
|
extern bool EnableSSL;
|
||||||
extern bool SilentMode;
|
extern bool SilentMode;
|
||||||
extern int MaxBackends;
|
extern int MaxBackends;
|
||||||
@ -222,7 +221,7 @@ extern int PostPortNumber;
|
|||||||
extern int Unix_socket_permissions;
|
extern int Unix_socket_permissions;
|
||||||
extern char *Unix_socket_group;
|
extern char *Unix_socket_group;
|
||||||
extern char *UnixSocketDir;
|
extern char *UnixSocketDir;
|
||||||
extern char *VirtualHost;
|
extern char *ListenAddresses;
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
Reference in New Issue
Block a user