Re: We should Axe /contrib/start-scripts - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: We should Axe /contrib/start-scripts
Date
Msg-id 20090825201634.GL12604@alvh.no-ip.org
Whole thread Raw
In response to Re: We should Axe /contrib/start-scripts  (Chander Ganesan <chander@otg-nc.com>)
Responses Re: We should Axe /contrib/start-scripts  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
Chander Ganesan wrote:
> Alvaro Herrera wrote:

> >This is something we're not quite ready on, yet.  We need some mechanism
> >that allows scripts to verify not only that postmaster started, but also
> >that it has finished recovery.  You can sort-of do it by attempting a
> >connection and checking the error message, but it's ugly.  There was
> >talk about a pg_ping utility years ago, but nobody got around to writing
> >it ...
> Can't you use pg_controldata to see whether it is in recovery or
> not?  Seems like you've got a way to see if it's running, seeing if
> it is in recovery should therefore be pretty straightforward, no?

That's within my definition of "ugly", yes :-)  My ideal tool would do
something like

$ pg_ping -h foo -p 5555
IN_RECOVERY
$ echo $?
2

$ # sleep a bit ...

$ pg_ping -h foo -p 5555
READY
$ echo $?
0

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: We should Axe /contrib/start-scripts
Next
From: "Kevin Grittner"
Date:
Subject: Re: We should Axe /contrib/start-scripts