Page 1 of 1

PostgreSQL and NOTIFY & LISTEN

Posted: Mon Dec 14, 2009 12:13 pm
by minihold
Is it possible in Revolution to LISTEN on notifications sent by the PostgreSQL database asynchronously?
I want to subscribe (LISTEN) with my client to messages sent after e.g. inserts into a specific table.
To active that, you create a rule on a table in postgresql:
CREATE RULE loginsert AS ON INSERT TO logmessages DO (NOTIFY loginsert);
For receiving this notification you have to use a LISTEN a command.
The notification mechanism is very useful to avoid polling a database table in defined time periods with SELECTs.

Thx in advance for answers,
Markus