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: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_ctl and port number detection
Date: 2010-12-18 23:08:04
Message-ID: 201012182308.oBIN84713812@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:
> > pg_ctl.c::test_postmaster_connection() has some fragile code that tries
> > to detect the server port number by looking in the pg_ctl -o string,
>
> It may be fragile, but it works; or at least I've not heard complaints
> about it lately.

True.

> > I think a simpler solution would be to look in postmaster.pid:
> > 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.

--
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 Tom Lane 2010-12-18 23:21:34 Re: pg_ctl and port number detection
Previous Message Tom Lane 2010-12-18 23:02:25 Re: pg_ctl and port number detection