> > LISTEN/NOTIFY is yet another SQL. We can write a rule on an event and let
> > it notify. On the other hand, we can have a while(1) process which keeps
> > listening for that notification ie.. event. Once the event is occured, the
> > listening process would be notified. The listening process can be any
> > postgresql client including the one written in C, perl, php, etc.
> But the problem still is: how to receive the NOTIFY from an php script ?
> which function of the c-client lib can be used for this ?
In perl, if i am correct, DBD::Pg does not support it. But, Pg - Perl5
extension for postgresql does it. The functions consumeInput() and
notifies can be used to access the notifyname and pid of backend process.
Refer the man page of Pg module for details.
In C, the functions PQconsumeInput() and PQnotifies can be used to access
the notifyname and pid of backend process. Refer the libpq man page for
details.
In php 4.3.0, the function pg_get_notify() can be used to access the
notifyname and pid of backend process. For details, please refer the below
link:
http://www.science.uva.nl/ict/documentation/php4/function.pg-get-notify.html
Hope it helps.
regards,
bhuvaneswaran