Re: Ability to listen on two unix sockets

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Florian Pflug <fgp(at)phlo(dot)org>, Honza Horak <hhorak(at)redhat(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ability to listen on two unix sockets
Date: 2012-06-13 22:25:23
Message-ID: 1339626323.11971.46.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On mån, 2012-06-11 at 18:07 -0400, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)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 = 5432
> listen_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.

Well, it's fine if we provide ways not to have the cross-product, but
there should also be an easy way to get it. I can easily see cases in
systems I have administered where I would have liked to use two unix
sockets, two IP sockets, and two ports. Maybe I actually would have
needed only 7 out of those 8 sockets, but it's far easier to configure,
document, and explain if I just set up all 8 of them.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2012-06-13 22:25:31 Re: [COMMITTERS] pgsql: Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented
Previous Message Peter Eisentraut 2012-06-13 22:19:39 Re: Ability to listen on two unix sockets