Introduction to the PHP Function Pg_Version
The article introduces php function pg_version, which returns the version of PostgreSQL used by your connection. This is useful for checking whether your application will work correctly with the database you are trying to connect to.
If pg_version() returns the wrong value, it might be because your version of PHP is too old. In that case, you should upgrade your PHP installation.
PostgreSQL errors are usually reported to the front-end with a human-readable error message and an SQLSTATE code that identifies the type of error that happened. The error message contains a primary human-readable text (typically one line) and the position in the original statement string where the error occurred. It may also contain a hint offering advice on what to do about the error.
The pg_result_error_field() function displays the same information as pg_result_status(), but with some extra fields for a more detailed description of the error that occured. These extra fields include:
pg_query_params() creates a prepared statement named stmtname from a query string containing a single SQL command. stmtname may be NULL to create an unnamed prepared statement, or it can be a string that names the parameter values that are referred to in the query as $1, $2, etc.
pg_pconnect() opens a new connection to the PostgreSQL database, if possible, using the parameters connect_string and param_names. If a connection with the same parameters already exists, pg_pconnect() will return an existing connection instead of a new one unless you specify PGSQL_CONNECT_FORCE_NEW as connect_type.