Re: [INTERFACES] Using Postgres's NOTIFY/LISTEN

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [INTERFACES] Using Postgres's NOTIFY/LISTEN
Дата
Msg-id 2637.912614023@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [INTERFACES] Using Postgres's NOTIFY/LISTEN  (Peter T Mount <peter@retep.org.uk>)
Ответы Re: [INTERFACES] Using Postgres's NOTIFY/LISTEN
Список pgsql-interfaces
Peter T Mount <peter@retep.org.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

В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [INTERFACES] Can a PGresult outlive a PGconn
Следующее
От: Peter T Mount
Дата:
Сообщение: Re: [INTERFACES] Using Postgres's NOTIFY/LISTEN