On Tue, Oct 12, 2004 at 12:20:46PM -0400, Eric D Nielsen wrote:
>
> I was hoping for a get/easy solution, but those never pan out :)
Here's a trivial Python program that handles NOTIFY events; it
couldn't get much easier:
#!/usr/local/bin/python
import psycopg
import select
conn = psycopg.connect('dbname=test')
conn.autocommit(1)
curs = conn.cursor()
curs.execute('LISTEN alert')
fd = curs.fileno()
while True:
select.select([fd], [], [], None)
curs.execute('SELECT 1')
print curs.notifies()
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/