X-Original-To: pgsql-interfaces@postgresql.org Received: from ll.mit.edu (LLMAIL.LL.MIT.EDU [129.55.12.40]) by postgresql.org (Postfix) with ESMTP id 72E6B47601F for ; Tue, 11 Mar 2003 12:16:48 -0500 (EST) Received: (from smtp@localhost) by ll.mit.edu (8.12.8/8.8.8) id h2BHGqpc004838 for ; Tue, 11 Mar 2003 12:16:52 -0500 (EST) Received: from sty.llan.ll.mit.edu( ), claiming to be "sty.llan" via SMTP by llpost, id smtpdAAApkaOyi; Tue Mar 11 12:16:44 2003 Date: Tue, 11 Mar 2003 12:16:44 -0500 From: george young To: pgsql-interfaces@postgresql.org Subject: listen/notify with python pgdb Message-Id: <20030311121644.333cdfff.gry@ll.mit.edu> Reply-To: gry@ll.mit.edu Organization: MIT Lincoln Laboratory X-Mailer: Sylpheed version 0.8.10 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200303/42 X-Sequence-Number: 3791 [postgresql 7.3, python 2.3a1, pygresql-3.4-pre021201] Does anyone use listen/notify with pgdb, the python DB-API interface? I've done a crude hack, but maybe someone has a nicer one? {Yes, I know notify is not part of the python DB-API: I'm trying to stay as close to portable API's and still get the work done...} Here's what I'm doing: #pgdb_extended.py '''This is a small wrapper module for pgdb, the Python DB-SIG 2.0 compliant implentation for postgresql access from python. This wrapper adds just one member function, viz. 'pgdbCnx.getnotify()'. getnotify just calls the postgresql libpq C API function getnotify() to get notify messages resulting corresponding to sql 'listen' commands that have been made.''' from pgdb import * def getnotify(self): return self._pgdbCnx__cnx.getnotify() pgdbCnx.getnotify = getnotify -- George -- I cannot think why the whole bed of the ocean is not one solid mass of oysters, so prolific they seem. Ah, I am wandering! Strange how the brain controls the brain! -- Sherlock Holmes in "The Dying Detective"