PHP Function pg_connection_status
php function pg_connection_status returns the status of a PostgreSQL connection resource. It is similar to the pg_query() function but with the ability to return a result resource instead of an error message.
The status is in the form of a string that can be one or more parameter settings separated by whitespace, for example keyword = value. Keywords and values can include boolean values, but should be enclosed in single quotes to prevent SQL injection attacks. The status may be ERROR, FATAL, PANIC, WARNING, NOTICE, DEBUG, INFO or LOG (in a notice message) or a localized translation of one of these.
If the connection status is PGSQL_CONNECTION_OK, pg_connect_status() will return a query result resource if pg_query() is successful or FALSE if not. Otherwise it will return a PGSQL_ERROR message.
pg_convert() converts the array of data into the right types for use in an SQL statement. The precondition for pg_convert() is that table_name has at least as many columns as assoc_array has elements, and that the field names in table_name match the indices in assoc_array. The datatypes must also be compatible.
pg_last_error() returns the last error message for a given connection. It is used to avoid overwriting errors if multiple calls to PostgreSQL modules generate messages at the same time. It is best to use pg_result_error_field(), pg_result_error_line() and pg_result_status() for better error handling. It is not recommended to use this function in production code unless it is strictly necessary.