Re: pg_ctl and port number detection

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_ctl and port number detection
Дата
Msg-id 4559.1292714494@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_ctl and port number detection  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: pg_ctl and port number detection  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> Tom Lane wrote:
>> Bruce Momjian <bruce@momjian.us> writes:
>>> pg_ctl already knows the data directory.  If the file is missing, the
>>> server is not running.  If the file exists, the first number on the last
>>> line, divided by 1000, is the port number.

>> That's somewhere between fragile and outright wrong.

> Please explain why my idea is not an improvement.

Because it's assuming that those numbers are sysv shmem keys derived in
a particular way.  We have platforms on which that is wrong, Windows
being the most obvious example.  Reading the shmem key assignment code
closely will suggest to you other ways that this could fail.  Not to
mention that people propose getting rid of sysv shmem approximately
every other month, and perhaps someday that will actually happen;
whereupon whatever might get logged in postmaster.pid could be something
completely different.

If you really think that pulling a port number out of the pid file is an
improvement over what pg_ctl does now, then you need to start by storing
the port number, as such, in the pid file.  Not something that might or
might not be related to the port number.  But what we have to discuss
before that is whether we mind having a significant postmaster version
dependency in pg_ctl.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_ctl and port number detection
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_ctl and port number detection