Re: Ability to listen on two unix sockets

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@commandprompt.com>, Florian Pflug <fgp@phlo.org>, Honza Horak <hhorak@redhat.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2012-06-11T21:54:03Z
Lists: pgsql-hackers
On sön, 2012-06-10 at 17:35 -0400, Tom Lane wrote:
> I'm unconvinced that allowing multiple port numbers is worth the
> amount of confusion it will cause.

Well, it's a feature that people have asked for.  I would love to have
it.  Much more than multiple Unix-domain socket locations.

> In particular, we've traditionally
> used "the port number" as part of the key for resources such as shared
> memory.

But it hasn't been a requirement for a long time that those match up
exactly.  It's already possible that they don't, if you configure
postmasters with the same port and non-conflicting IP addresses or
Unix-socket locations.

> I think we'd want the number used for that purpose to be what
> is written into the lock file ... but then what if the postmaster is
> not actually listening on *any* actual socket with that number?
> pg_ctl will not be happy.
> 
I'm not sure why pg_ctl needs to know about the shared memory business.
We write the shared memory key into the lock file, so the port number in
the lock file should just be a port number for pg_ctl to use.  Of course
you can configure things so that pg_ctl cannot contact the postmaster,
but this problem already exists in a more likely fashion with
listen_addresses.  Adding an extra port doesn't make it more likely.