Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) by hub.org (8.9.1/8.9.1) with ESMTP id KAA20464 for ; Wed, 2 Dec 1998 10:58:23 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id KAA02639; Wed, 2 Dec 1998 10:53:43 -0500 (EST) To: Peter T Mount cc: pgsql-interfaces Subject: Re: [INTERFACES] Using Postgres's NOTIFY/LISTEN In-reply-to: Your message of Wed, 2 Dec 1998 06:46:53 +0000 (GMT) Date: Wed, 02 Dec 1998 10:53:43 -0500 Message-ID: <2637.912614023@sss.pgh.pa.us> From: Tom Lane Peter T Mount 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