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

From Tom Lane
Subject Re: Ability to listen on two unix sockets
Date
Msg-id 20726.1339452454@sss.pgh.pa.us
Whole thread Raw
In response to Re: Ability to listen on two unix sockets  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Ability to listen on two unix sockets
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On sön, 2012-06-10 at 17:24 -0400, Robert Haas wrote:
>>> Why would that matter?  If you configure M ports and N Unix socket
>>> locations, you get M*N actual sockets created.

>> ...I *seriously* doubt that this is the behavior anyone wants.
>> Creating M sockets per directory seems patently silly.

> How else would it work?

> If I say, syntax aside, listen on "ports" 5432 and 5433, and use socket
> directories /tmp and /var/run/postgresql, then a libpq-using client
> would expect to be able to connect using

This argument seems quite circular to me: you are assuming that we will
adopt exactly the behavior that Robert is questioning.

What would make more sense to me is

(1) there is still a *single* "port" parameter, which is what we use for
things like shared memory keys;

(2) listen_addresses (and the hypothetical socket_directories list)
grows the ability to specify a port number in any list element.  The
primary port number parameter sets the default.

So for instance
port = 5432listen_addresses = '*, 127.0.0.1:5433'

results in listening on *:5432 and 127.0.0.1:5433.

> So you do need to create M*N sockets.
> I don't really see a problem with that.

I do: first, it's a lotta sockets, and second, it's not real hard to
foresee cases where somebody actively doesn't want that cross-product.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [COMMITTERS] pgsql: Run pgindent on 9.2 source tree in preparation for first 9.3
Next
From: Michael Nolan
Date:
Subject: Re: Ability to listen on two unix sockets