From: Bruce Momjian <bruce@momjian.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
Cc: Mark Llewellyn <mark_llewellyn@adp.com>
Cc: pgsql-hackers@postgresql.org
Cc: Sujeet Rajguru <sujeet.rajguru@enterprisedb.com>
Subject: Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Date: Thu, 25 Nov 2010 13:11:44 -0500 (EST)
Message-ID: <201011251811.oAPIBiP21864@momjian.us> (raw)
In-Reply-To: <201011240514.oAO5Ejd22656@momjian.us>
Bruce Momjian wrote:
> > > BTW, it is annoying that we can't definitively distinguish "postmaster
> > > is not running" from a connectivity problem, but I can't see a way
> > > around that.
> >
> > Agreed. I will research this.
>
> I have researched this and developed the attached patch. It implements
> PGping() and PGpingParams() in libpq, and has pg_ctl use it for pg_ctl
> -w server status detection.
>
> The new output for cases where .pgpass is not allowing for a connection
> is:
>
> $ pg_ctl -w -l /dev/null start
> waiting for server to start.... done
> server started
> However, could not connect, perhaps due to invalid authentication or
> misconfiguration.
>
> The code basically checks the connection status between PQconnectStart()
> and connectDBComplete() to see if the server is running but we failed to
> connect for some reason.
I have applied this patch, with modified wording of the "cannot connect"
case:
$ pg_ctl -w -l /dev/null start
waiting for server to start.... done
server started
warning: could not connect, perhaps due to invalid authentication or
misconfiguration.
I assume having the warning as the last printed things is appropriate.
This is my second patch this week that got little feedback --- I am
getting a little spooked. ;-)
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, magnus@hagander.net, ashesh.vashi@enterprisedb.com, mark_llewellyn@adp.com, pgsql-hackers@postgresql.org, sujeet.rajguru@enterprisedb.com
Subject: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
In-Reply-To: <201011251811.oAPIBiP21864@momjian.us>
References: <201011240514.oAO5Ejd22656@momjian.us> <201011251811.oAPIBiP21864@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox