Re: Can the frontend get notifications from the postgres

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: <weigelt(at)metux(dot)de>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Can the frontend get notifications from the postgres
Date: 2003-06-17 12:08:43
Message-ID: Pine.LNX.4.33.0306170605270.1572-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

On Tue, 17 Jun 2003 weigelt(at)metux(dot)de wrote:

> On Tue, Jun 17, 2003 at 12:07:31PM +0530, A.Bhuvaneswaran wrote:
>
> <snip>
> > 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 ?

If you're talking about a PHP script running under apache as a module or
CGI, then you probably can't (or if you can, you shouldn't due to time out
issues and such.)

Note that PHP really is a "real programming language", and if you write a
program to execute from the command line and detach it can run in the back
ground like any other language, even starting child processes and having
IPC and all that. Look up the "Process Control Functions" for more on
satrting child processes and all.

Note that the pcntl_* functions are not guaranteed to behave when run
under apache / as a CGI etc...

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Anagha Joshi 2003-06-17 12:13:10 Notification
Previous Message Jean-Christian Imbeault 2003-06-17 09:11:56 Bad link on techdocs

Browse pgsql-sql by date

  From Date Subject
Next Message Anagha Joshi 2003-06-17 12:13:10 Notification
Previous Message scott.marlowe 2003-06-17 12:02:27 Re: select date range?