Re: Need some advice on appropriate PL strategy... ["solved/thanks"] - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Need some advice on appropriate PL strategy... ["solved/thanks"]
Date
Msg-id 20041014172033.GA95872@winnie.fuhr.org
Whole thread Raw
In response to Re: Need some advice on appropriate PL strategy... ["solved/thanks"]  (Eric D Nielsen <nielsene@MIT.EDU>)
List pgsql-general
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 by date:

Previous
From: Steven Klassen
Date:
Subject: Re: Verifying a user.
Next
From: Andreas
Date:
Subject: Is there an opposite to pg_get_userbyid() ?