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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Allow Postgres to pick an unused port to listen
Дата
Msg-id 1164328.1681323870@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Allow Postgres to pick an unused port to listen  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [PATCH] Allow Postgres to pick an unused port to listen  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Apr 12, 2023 at 1:56 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Yeah.  My main concern here is with limiting our ability to change
>> the pidfile format in future.  If we can keep the dependencies on that
>> localized to code we control, it'd be much better.

> I don't know if it's considered officially supported, but I often use
> pg_ctl stop on a directory without worrying about whether I'm doing it
> with the same server version that's running in that directory. I'd be
> reluctant to break that property. So I bet our ability to modify the
> file format is already quite limited.

IMO, the only aspect we consider "officially supported" for outside
use is that the first line contains the postmaster's PID.  All the
rest is private (and has changed as recently as v10).  Without
having actually checked the code, I think that "pg_ctl stop" relies
only on that aspect, or at least it could be made to do so at need.
So I think your example would survive other changes in the format.

I don't really want external code knowing that line 4 is the port,
because I foresee us breaking that someday --- what will happen
when we want to allow one postmaster to support multiple ports?
Maybe we'll decide that we don't have to reflect that in the
pidfile, but let's not constrain our decisions ahead of time.

            regards, tom lane



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

Предыдущее
От: Jacob Champion
Дата:
Сообщение: Re: postgres_fdw, dblink, and CREATE SUBSCRIPTION security
Следующее
От: Jacob Champion
Дата:
Сообщение: Re: postgres_fdw, dblink, and CREATE SUBSCRIPTION security