pg_last_notice

(PHP 4 >= 4.0.6)

pg_last_notice --  Returns the last notice message from PostgreSQL server

Description

string pg_last_notice ( resource connection)

pg_last_notice() returns the last notice message from PostgreSQL server specified by connection. PostgreSQL server set notice message when transaction cannot be continued. There one can avoid issuing useless SQL using pg_exec() using pg_last_notice(). There are other cases that PostgreSQL server sets notice message. Programmer must check contents of notice message if it is related to transaction or not.

Warning

This function is EXPERIMENTAL and it is not fully implemented yet. pg_last_notice() is added form PHP 4.0.6. However, PHP 4.0.6 has problem with notice message handling. Use of PostgreSQL module with PHP 4.0.6 is not recommended even if you are not using pg_last_notice().

See also pg_exec() and pg_errormessage().