Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Mark Llewellyn <mark_llewellyn(at)adp(dot)com>, pgsql-hackers(at)postgresql(dot)org, Sujeet Rajguru <sujeet(dot)rajguru(at)enterprisedb(dot)com>
Subject: Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Date: 2010-09-24 20:30:52
Message-ID: 4C9D0A7C.80400@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 09/24/2010 11:11 AM, Tom Lane wrote:
> Andrew Dunstan<andrew(at)dunslane(dot)net> writes:
>> On 09/24/2010 10:15 AM, Magnus Hagander wrote:
>>> In that case, we should probably teach pg_ctl about this case, no?
>>> Since it clearly gives an incorrect message to the user now...
>> pg_ctl decides that the server is running iff it can connect to it. Do
>> you intend to provide for a different test?
> Seems like getting a password challenge from the server is sufficient
> evidence that the server is running, whether we are able to meet the
> challenge or not. Perhaps we could just twiddle pg_ctl's "is it up"
> test a bit to notice whether the connect failure was of this sort.

pg_ctl does in fact use that sort of logic:

if ((conn = PQconnectdb(connstr)) != NULL &&
(PQstatus(conn) == CONNECTION_OK ||
PQconnectionNeedsPassword(conn)))

But of course, libpq won't set that last condition if there is a bad
password in the pgpass file, which seems a rather perverse thing to do.

cheers

andrew

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message stagirus 2010-09-24 21:33:57 Mapping Hibernate boolean to smallint(Postgresql)
Previous Message Peter Eisentraut 2010-09-24 16:35:21 Re: installer problems

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-09-24 21:05:01 Re: Path question
Previous Message Robert Haas 2010-09-24 20:01:24 Re: levenshtein_less_equal (was: multibyte charater set in levenshtein function)