Re: postmaster listening on specified addresses - Mailing list pgsql-general

From Doug McNaught
Subject Re: postmaster listening on specified addresses
Date
Msg-id 877jmfwx6q.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to postmaster listening on specified addresses  (Administrator <admin@photoresearchers.com>)
Responses PQisBusy() always returns TRUE  (ntinos@aueb.gr)
List pgsql-general
Administrator <admin@photoresearchers.com> writes:

> Hello,
>
> I was wondering if there's a correct method for running postmaster
> with the option of listening on a select group of addresses.  Does
> postmaster accept multiple "-h hostname" options on the command-line,
> or alternatively a comma-separated list of hostnames or addresses?
> What if you have a server with multiple network interfaces and
> addresses assigned to each, and you only want postmaster to listen on
> a specific subset of those addresses in addition to localhost?  Does
> anyone know if there a supported method for doing this?

It would require changes to the existing code (see below).

> The documentation for the "-h" option only states: "Specifies the
> TCP/IP host name or address on which the postmaster is to listen for
> connections from client applications. Defaults to listening on all
> configured addresses (including localhost)."  Clearly the server is
> capable of listening on mutliple addresses since the default is all of
> them, but the "-h" option is described only for use with a single
> address.

Actually, in the sockets API to listen on "all configured addresses"
you specify the "wildcard" address (0.0.0.0).  There is no call to
"listen on this list of addresses".  What you are looking for could be
done, but it would require multiple listening sockets, one for each
address, which (as far as I know) the code doesn't currently do.

-Doug

pgsql-general by date:

Previous
From: Richard_D_Levine@raytheon.com
Date:
Subject: Re: MOVE
Next
From: Michael Fuhr
Date:
Subject: Re: postmaster listening on specified addresses