Use the Notification System?

Top  Previous  Next

Postgresql provides a powerful Asynchronous Notification system that can be used to send notifications to client applications

when changes occur.

To set this up you simply need to add a rule to the table you would like to monitor for changes.

 

Add the rule name and the definition like so:




 

Or you could enter the following in the query editor:

create rule insert_detect as on INSERT to yourtablename do notify recinsert;

 

Then click OK.  Whenever a insert happens for this table a notification called recinsert will be sent to all the clients that are

connected.

 

The client could then automatically refresh a grid to show the newly inserted records.