Re: pg_ctl and port number detection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(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 17:41:34
Message-ID: 11425.1292866894@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Tom Lane wrote:
>> 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'm not sure why you're having such a hard time grasping this concept.
We do not want pg_ctl looking at the shmem key information, not even to
the extent of assuming a particular format for it. Therefore the port
number has to go before it not after it. What I'm thinking of is

pid
datadir
port
... here be dragons ...

Actually, if we're going to do this at all, we should do

pid
datadir
port
socketdir
... here be dragons ...

so that pg_ctl doesn't have to assume the server is running with a
default value of unix_socket_dir. Not sure what to put in the fourth
line on Windows though ... maybe just leave it empty?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-12-20 17:45:26 Re: serializable lock consistency
Previous Message Alvaro Herrera 2010-12-20 17:40:06 Re: Extensions and custom_variable_classes