Re: Ability to listen on two unix sockets

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-10 21:06:05
Message-ID: 1339362365.5751.42.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-06-10 21:24:35 Re: Ability to listen on two unix sockets
Previous Message Noah Misch 2012-06-10 20:53:24 Re: [PATCH] Support for foreign keys with arrays