From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Peter T Mount <peter(at)retep(dot)org(dot)uk> |
Cc: | pgsql-interfaces <pgsql-interfaces(at)postgreSQL(dot)org> |
Subject: | Re: [INTERFACES] Using Postgres's NOTIFY/LISTEN |
Date: | 1998-12-02 15:53:43 |
Message-ID: | 2637.912614023@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
Peter T Mount <peter(at)retep(dot)org(dot)uk> writes:
> On Wed, 2 Dec 1998, John Bosch wrote:
>> I'm using Postgresql as the database for a Java application I am writing
>> and would like to use the NOTIFY/LISTEN feature of Postgres.
> Ok, you've got me thinking... It shouldn't be too difficult to add NOTIFY
> support. I'll have a look at it during this morning, and I'll get back to
> you.
NOTIFY is no problem --- there's no particular reason not to issue
NOTIFY as a plain SQL command. It's the LISTEN side of things that
will require some driver support.
Ideally, you'd like to be able to invoke an application-supplied
callback routine asynchronously when a notify message arrives.
I don't know enough about Java to know if it has a well-defined
event loop mechanism, but if it does and your driver can cause events
to be issued, you should be in fat city.
You might care to look at libpgtcl's listen support in 6.4 --- it
automatically issues LISTEN and UNLISTEN commands when the application
registers or deregisters a callback request.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Peter T Mount | 1998-12-02 18:49:25 | Re: [INTERFACES] Using Postgres's NOTIFY/LISTEN |
Previous Message | Tom Lane | 1998-12-02 15:45:40 | Re: [INTERFACES] Can a PGresult outlive a PGconn |