I've attached a chump little utility called pg_ping(1) and the
necessary update to pg_ctl(1) to see if a database is up and running
or not. There are three things that I haven't completed with this
that I'll try and get to the next time I have a small chunk of time
available:
1) I'd hoped to add some basic profiling support so that admins could
time the amount of time it takes to have a connection be
established (I've found it to be strangely useful).
2) A -f switch that does a "full" test and actually executes "SELECT
TRUE" from the database.
3) Poke around to see if I could add support for getopt_long()
Anyway, let me throw this out that way it can get kicked around as
appropriate. Because it's so simple in its nature and because right
now pg_ctl(1) is kinda broken in its current state (setup any kind of
auth and pg_ctl hangs), it'd be slick 50 if this patch could sneak
into the 7.4 release. :)
-sc
PS, it looks like there's a bug in the backend (not sure how old my
CVS copy is) if you comment out all of you pg_hba.conf entries, you
get a garbled message on the backend:
2003-07-18 15:53:40 [15386] FATAL: No pg_hba.conf entry for host ^L, user pgsql, database template1
^^
--
Sean Chittenden