Re: PostgreSQL_db_change_notification

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: PostgreSQL_db_change_notification
Дата
Msg-id 407d949e0907061127n4aa61994sce02724004c27e76@mail.gmail.com
обсуждение исходный текст
Ответ на PostgreSQL_db_change_notification  (iceDice <nmilasinovic@gmail.com>)
Список pgsql-jdbc
On Mon, Jul 6, 2009 at 6:57 PM, iceDice<nmilasinovic@gmail.com> wrote:
>
> Does PostgreSQL supports some database change notification mechanism?
> I have Java Swing application and PostgreSQL database for storing data.
> The problem is that my database can change at any moment and instead of
> querying
> the database every 5 seconds, I would like the database to some how send my
> application
> a notification of a change when it happens.

The Postgresy way to do this is to have triggers on the tables you
want to watch which use the NOTIFY command. Then have your client
issue a LISTEN.

I'm not sure how this works with JDBC though...

--
greg
http://mit.edu/~gsstark/resume.pdf

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

Предыдущее
От: iceDice
Дата:
Сообщение: PostgreSQL_db_change_notification
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Retrieving results from ARRAY and ROW