Re: Need some advice on appropriate PL strategy... ["solved/thanks"]
От
Michael Fuhr
Тема
Re: Need some advice on appropriate PL strategy... ["solved/thanks"]
Дата
Msg-id
20041014172033.GA95872@winnie.fuhr.org
Ответ на
Re: Need some advice on appropriate PL strategy... ["solved/thanks"] (Eric D Nielsen)
Список
Дерево обсуждения
Re: Need some advice on appropriate PL strategy... ["solved/thanks"] Eric D Nielsen <nielsene@MIT.EDU>
Re: Need some advice on appropriate PL strategy... ["solved/thanks"] Michael Fuhr <mike@fuhr.org>
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/
В списке pgsql-general по дате отправления