int pg_connection_status ( resource $connection )
pg_connection_status() returns the status of the specified connection.
PGSQL_CONNECTION_OK or PGSQL_CONNECTION_BAD.