The 5th Annual China PHP Conference


(PHP 4 >= 4.3.0, PHP 5, PHP 7)

pg_get_notifyPing database connection


array pg_get_notify ( resource $connection [, int $result_type ] )

pg_get_notify() gets notify message sent by NOTIFY SQL command. To recieve nofigy messages, LISTEN SQL command must be issued. If there is notify message on the connection, array contains message name and backend PID is returned. If there is no message, FALSE is returned.

See also pg_get_pid()

Example #1 PostgreSQL NOTIFY message

pg_pconnect ("dbname=publisher");
if (!
$conn) {
"An error occured.\n";

// Listen 'author_updated' message from other processes
pq_query($conn'LISTEN author_updated;');
$notify pg_get_notify($conn);
if (!
"No messages\n");

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top