Re: Ability to listen on two unix sockets - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Ability to listen on two unix sockets
Date
Msg-id 1339362365.5751.42.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: Ability to listen on two unix sockets  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Ability to listen on two unix sockets
List pgsql-hackers
On sön, 2012-06-10 at 09:41 -0400, Robert Haas wrote:
> I think we should consider this in the context of allowing both
> additional UNIX sockets and additional TCP ports.  In the case of TCP
> ports, it's clearly no good to turn "port" into a list, because one
> port number has to be primary, since it goes into the PID file

Not necessarily.  The port number in the PID file is only used for
pg_ctl to contact the server, and for that it only needs some port, not
the primary one.  Also, we write the first listen_address into the PID
file for the same reason.  So if you think there should be a primary
port, then there should also be a primary listen_addresses.

> and also affects the naming of any UNIX sockets created.

Why would that matter?  If you configure M ports and N Unix socket
locations, you get M*N actual sockets created.

> If we add
> secondary_socket_dirs, I think we will also need secondary_ports.  One
> idea might be to have one new GUC that serves both purposes:
> 
> additional_sockets = '12345, /foo'

I was getting around to that, although I don't follow the specific
syntax you have chosen here.

I would like something where you set host and port together, so you can
listen on port 5432 on localhost, and port 5433 on *, for example.  So
maybe

listen_addresses = localhost:5432,*:5433

Web servers usually allow that sort of thing, but if you dig deep there,
the configuration settings and their interactions can get pretty
complicated.  For example, you can usually set a default port and then
override it in the listen_addresses equivalent.




pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: [PATCH] Support for foreign keys with arrays
Next
From: Robert Haas
Date:
Subject: Re: Ability to listen on two unix sockets