PHP Function pg_Last_Notice
In this article you will learn about php function pg_last_notice, which is a handy function for getting the last PostgreSQL notice that was issued. It is especially useful when working with the pg_sql_error_log notice handler, which catches all PostgreSQL errors and logs them to a file. This is important because you can not know which query has an error until you check the error log.
pg_last_notice() returns the last notice that was issued by the PostgreSQL server. It can only return one notice, even if more than one was issued by the server.
PostgreSQL notices are only propagated through stderr once they are caught by the pg_error_log notice handler, and the last notice that was issued is stored in a variable which can be retrieved using the pg_last_notice() function. So if you are trying to work with queries and want to see which error messages they have been receiving, you should use the pg_error_log function instead of this function, as it will give much more detail on the error message.
pg_put_line() sends a NULL-terminated line directly to the PostgreSQL backend, which is used in conjunction with the high speed data loading interface supported by PostgreSQL's COPY FROM command. This interface uses the pg_query_params function, which allows SQL commands and separate parameters to be submitted to the server without waiting for the result(s). Like pg_prepare(), it will not work with pre-7.4 PostgreSQL connections. It also does not support the SET CONTINUE SQL statement option, and it can only contain one command.