Page 1 of 1

Liten / Notify

Posted: Thu 12 Jul 2007 17:27
by jkucera
Hi, I've seen the support for Listen/Notify is there since 3.00 version. Maybe I missed something but how the command LISTEN is implemented. The handling of notifications is implemented as PgSqlConnection event, but how to "subscribe" to listen?

Posted: Fri 13 Jul 2007 10:17
by Alexey
You should execute PgSqlCommand with "listen" keyword. This will subscribe you to the event. When notification trigger in your database fires, you will get Notification event in PgSqlConnection. Note that asynchronous notifications are not supported yet, so you'll need to execute something to get notification event.