Re: Bug? 'psql -l' in pg_ctl? - Mailing list pgsql-general

From Tom Lane
Subject Re: Bug? 'psql -l' in pg_ctl?
Date
Msg-id 7498.975531546@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug? 'psql -l' in pg_ctl?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
Peter Eisentraut <peter_e@gmx.net> writes:
>> Really we'd need to change the postmaster too, because what we need to
>> do is send a query "are you ready to accept connections?" that the
>> postmaster will answer without an authentication exchange.

> ISTM that the rejection of a client with authentication failure is a
> pretty good indicator that you're accepting connections.

Well, no, it means that the postmaster is alive.  It doesn't mean the
database is open for business yet --- the startup subprocess might still
be running.

I've just tweaked the postmaster so that startup/shutdown state is
checked immediately upon receiving the startup-request packet, and if
there's a database-state reason for rejecting the connection, that
will happen before going through the authentication protocol.  This
should make it easier to write a pg_ping.

            regards, tom lane

pgsql-general by date:

Previous
From: "Steve Wolfe"
Date:
Subject: Re: Database cluster?
Next
From: "kurt miller"
Date:
Subject: ExecRestrPos: node type 18 not supported