pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: weigelt@metux.de
Cc: pgsql-admin@postgresql.org
Subject: Re: Can the frontend get notifications from the postgres
Date: Tue, 17 Jun 2003 06:08:43 -0600 (MDT)
Message-ID: <Pine.LNX.4.33.0306170605270.1572-100000@css120.ihs.com> (raw)
In-Reply-To: <20030617080102.GB1959@metux.de>

On Tue, 17 Jun 2003 weigelt@metux.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...




view thread (10+ messages)  latest in thread

Message-ID: <Pine.LNX.4.33.0306170605270.1572-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0306170605270.1572-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0306170605270.1572-100000@css120.ihs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scott.marlowe@ihs.com, weigelt@metux.de, pgsql-admin@postgresql.org
  Subject: Re: Can the frontend get notifications from the postgres
  In-Reply-To: <Pine.LNX.4.33.0306170605270.1572-100000@css120.ihs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox