[odb-users] ODB and the PostgreSQL asynchronous notification facility

Hugo.Mildenberger at web.de Hugo.Mildenberger at web.de
Tue Apr 30 06:56:46 EDT 2013


Boris,

with the NOTIFY / LISTEN statements, PostgreSQL provides the means for the asynchronous notification of its clients connected to the same database. The NOTIFY statement can be issued e.g. by a trigger procedure when a certain table was changed due to update, insert or delete operations. 

$ psql
  =>
  =>listen "channel-person";
  LISTEN
  => notify "channel-person", 'update person id 7719992/221231';
  NOTIFY
  Asynchronous notification "channel-person" with payload "update person id 7719992/221231" received from 
   server process with PID 26257.
  =>

Would it be possible to extend the PostgreSQL-specific ODB connection object to make it aware of asynchronous messages and call a virtual method upon arrival? As I understood the documentation, asynchronous messages will not arrive during an outstanding transaction. But this does not seem to be true when using "psql-9.2" interactively. I repeatedly got an outstanding notification from another process immediately after "BEGIN" was executed. Yet it may well be that this is only a defect within the "psql" client program. 

Hugo



More information about the odb-users mailing list