Re: Need some advice on appropriate PL strategy... ["solved/thanks"]

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Eric D Nielsen <nielsene(at)MIT(dot)EDU>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Need some advice on appropriate PL strategy... ["solved/thanks"]
Date: 2004-10-14 17:20:33
Message-ID: 20041014172033.GA95872@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas 2004-10-14 17:42:22 Is there an opposite to pg_get_userbyid() ?
Previous Message Steven Klassen 2004-10-14 17:19:24 Re: Verifying a user.