Skip site navigation (1) Skip section navigation (2)

Problems using psycopg2 listen features

From: "Hassan, Aydin" <aydin(dot)hassan(at)wwctrials(dot)com>
To: "'psycopg(at)postgresql(dot)org'" <psycopg(at)postgresql(dot)org>
Subject: Problems using psycopg2 listen features
Date: 2012-08-22 09:10:58
Message-ID: A2B8DC2BE91D124A95588B04B02B15AF13F994FB92@EUMBX.wwctrials.com (view raw or flat)
Thread:
Lists: psycopg
Hi

I am trying to use the notify/listen features of postgres and psycopg2, however when using example code from the documents and running notify.py script in:
/psycopg2-2.4.5/examples$ python notify.py

I get the following error when send a notification from postgres:

Traceback (most recent call last):
  File "notify.py", line 45, in <module>
    conn.poll()
AttributeError: 'psycopg2._psycopg.connection' object has no attribute 'poll'

Not sure why I am getting this error as it is example code?

I am running:

Python: 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
Ubuntu:
Distributor ID: Ubuntu
Description:    Ubuntu 10.04.3 LTS
Release:        10.04
Codename:       lucid

And the latest psycopg2

________________________________
This email contains confidential information which may also be legally privileged and subject to protection under the law. It is intended only for the use of the individual or entity named above. If the reader of this email is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby on notice that you are in possession of confidential and privileged information. Any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please return it by email to the sender and delete the copy from your system.
Worldwide Clinical Trials Limited, 1 Fleet Place, London EC4M 7WS is Registered in England No. 6291766

psycopg by date

Next:From: Matthieu RigalDate: 2012-08-24 12:16:00
Subject: Problems between psycopg2 2.4.5 and OS X 10.8 Mountain Lion on libssl.dylib and libcrypto.dylib
Previous:From: Marko KreenDate: 2012-08-07 20:28:28
Subject: Re: libpq custom row processing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group