(PHP 4 >= 4.2.0)
pg_connection_status() returns a connection status. Possible statuses are PGSQL_CONNECTION_OK and PGSQL_CONNECTION_BAD.
See also pg_connection_busy().