I am using
pg_ctl -D $PGDATA status to monitor whether my postgres standby database is up and running. Sometimes the database fails to start due to a missing WAL file, but its status is reported as "available".
Is there a simple way to see if postgres is available using the
pg_ctl status option, or do I need to write a script to query the postgres database and monitor the output from script?