Re: pg_ctl and port number detection

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_ctl and port number detection
Date: 2010-12-20 12:40:31
Message-ID: 201012201240.oBKCeVq28178@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> >> I wonder if we should write the port number as the 4th line in
> >> postmaster.pid and return in a few major releases and use that. We
> >> could fall back and use our existing code if there is no 4th line.
>
> No. If it goes in, it should go in as the third line. The shmem key
> data is private to the server --- we do not want external programs
> assuming anything at all about the private part of postmaster.pid.

OK, so you are suggesting having it as a third value on the third line?

10231
/u/pgsql/data
5432001 45481984 port_here
^^^^^^^^^
I like that better because it simplifies the test and limits the
possibility of non-atomic multi-line writes. For Win32, we would just
have the port number because the line is normally empty.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-12-20 13:20:04 Re: bug in SignalSomeChildren
Previous Message Heikki Linnakangas 2010-12-20 12:13:59 Re: serializable lock consistency