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

From Tatsuo Ishii
Subject Re: Bug? 'psql -l' in pg_ctl?
Date
Msg-id 20001129151546S.t-ishii@sra.co.jp
Whole thread Raw
In response to Re: Bug? 'psql -l' in pg_ctl?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bug? 'psql -l' in pg_ctl?
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 ...)

Agreed.

Do you think it's a good idea to invent a new command such as
"pg_ping" or should we add a new option to psql instead?
--
Tatsuo Ishii

pgsql-general by date:

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