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 6114.975295468@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug? 'psql -l' in pg_ctl?  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: Bug? 'psql -l' in pg_ctl?  (GH <grasshacker@over-yonder.net>)
Re: Bug? 'psql -l' in pg_ctl?  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-general
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> Probably we really need here is a kind of ping tool for PostgreSQL,
> instead of using psql.

> You could directory invoke postmaster but problem is there is no
> reliable way to detect if PostgreSQL up and running other than
> trying to make an actual communication with backend...

I thought about watching for the postmaster.pid file to appear,
but that happens before the system is really up and running
--- the startup process isn't finished, and could still fail.
(Writing the pidfile later doesn't seem like a good answer to that,
since that'd weaken its main purpose of interlocking against
multiple postmaster startups.)

Trying to connect does seem to be the most reliable way to verify
that the postmaster is open for business.

(BTW, a short-term answer for grasshacker is not to use -w in his
pg_ctl start script ...)

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug? 'psql -l' in pg_ctl?
Next
From: GH
Date:
Subject: Re: Bug? 'psql -l' in pg_ctl?