Re: [PATCH] Allow Postgres to pick an unused port to listen

Поиск
Список
Период
Сортировка
От Yurii Rashkovskii
Тема Re: [PATCH] Allow Postgres to pick an unused port to listen
Дата
Msg-id CA+RLCQy1FjPpSWxgJMPXA4xe64kXsEEtXwcVtcbNPAMscZt0qA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Allow Postgres to pick an unused port to listen  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCH] Allow Postgres to pick an unused port to listen  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Alvaro, Tom,

On Mon, May 8, 2023 at 4:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> This made me wonder if storing the unadorned port number is really the
> best way.  Suppose we did extend things so that we listen on different
> ports on different interfaces; how would this scheme work at all?

Yeah, the probability that that will happen someday is one of the
things bothering me about this proposal.  I'd rather change the
file format to support that first (it can be dummy for now, with
all lines showing the same port), and then document it second.

How soon do you think the change will occur that will allow for choosing different ports on different interfaces? I am happy to help address this.

Relying on a variable number of lines may be counter-productive here if we want postmaster.pid to be easily readable by shell scripts. What if we
improved the port line to be something like this?

```
127.0.0.1=5432 ::1=54321
```

Basically, a space-delimited set of address/port pairs (delimited by `=` to allow IPv6 addresses to use a colon). If we allow the address side to be dropped, the current format (`5432`) will also be correct parsing-wise.

--
Y.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Yurii Rashkovskii
Дата:
Сообщение: Re: [PATCH] Allow Postgres to pick an unused port to listen
Следующее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: Add two missing tests in 035_standby_logical_decoding.pl