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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Дата
Msg-id 201011251811.oAPIBiP21864@momjian.us
обсуждение исходный текст
Ответ на Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-hackers
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 startwaiting for server to start.... doneserver startedwarning:  could not connect, perhaps
dueto invalid authentication ormisconfiguration.
 

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. +


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: problem with Win32 buildfarm
Следующее
От: Maciek Sakrejda
Дата:
Сообщение: Re: [JDBC] JDBC and Binary protocol error, for some statements