Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Date
Msg-id 201011171850.oAHIoM018166@momjian.us
Whole thread Raw
In response to Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
List pgsql-hackers
Magnus Hagander wrote:
> > I basically report the connection error string if it starts with "FATAL:".
> >
> > I originally tried to check for an ERRCODE_INVALID_PASSWORD error field
> > (see // comments), but it seems there is no way to access this, i.e.
> > PQgetResult(conn) on a connection failure is always NULL.
> >
> > Anyway, perhaps FATAL is a better test because it will report any major
> > failure, not just a .pgpass one.
> >
> > Patch attached.
> 
> Bad Bruce, using C++ comments like that :P And non-context diff ;)

That comment use was to highlight that those are not for commit, but
there if people want to test.

As far as the diff, it seems git-external-diff isn't portable to
non-Linux systems;  I will post a separate email on that.

> Does this actually solve the *problem*, though? The problem is not
> what is reported  on stdout/stderr, the problem is that the net result
> is that the server is reported as not started (by the service control
> manager) when it actually *is* started. In this case, stderr doesn't
> even go anywhere. What happens if you *don't* Ctrl-C it?

I was just going to post on that.  :-)  Right now, it prints the FATAL
and keeps printing 60 times, then says not running.  Should we just exit
on FATAL and output a special exit string, or say running?

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: unlogged tables
Next
From: Magnus Hagander
Date:
Subject: Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running