Question: what is pg_query in php?
Answer: pg_query() executes the query on the specified database connection . pg_query_params() should be preferred in most cases. If an error occurs, and FALSE is returned, details of the error can be retrieved using the pg_last_error() function if the connection is valid.