Re: Can the frontend get notifications from the postgres - Mailing list pgsql-admin

From A.Bhuvaneswaran
Subject Re: Can the frontend get notifications from the postgres
Date
Msg-id Pine.LNX.4.44.0306171744330.10221-100000@Bhuvan.bksys.co.in
Whole thread Raw
In response to Re: Can the frontend get notifications from the postgres server?  (weigelt@metux.de)
Responses Re: Can the frontend get notifications from the postgres server?
List pgsql-admin
> > 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


pgsql-admin by date:

Previous
From: "Anagha Joshi"
Date:
Subject: Notification
Next
From: "Brent Howard"
Date:
Subject: Starting postgres on Solaris