This project is archived and is in readonly mode.

#19 ✓invalid
Psycopg website

Missing cursor.isready and cursor.fileno in 2.3.0

Reported by Psycopg website | November 25th, 2010 @ 11:41 AM

Submitted by: Paul Reznicek

There are no more isready and fileno in cursor, so that using select to wait for notify make problems. Fileno can be used from connection, but without isready the waiting for notification is difficult.

Comments and changes to this ticket

  • Daniele Varrazzo

    Daniele Varrazzo November 25th, 2010 @ 12:08 PM

    • State changed from “new” to “invalid”


    isready() was dropped in the async overhaul performed in psycopg 2.2 release.

    fileno() was moved from the cursor to the connection, as it is the connection to wrap the socket. You can access it using cur.connection.fileno().

    Listening for notify whould be easier than it was before 2.2: use connection.poll() and check if there is anything new in notifies. More efficient than continuous polling, you can use conn.fileno() in a wait facility such as select() and only poll when there is something to read. There is no more need for isready(): poll() cares about it. The doc contains examples about how to use the interface.

    It should be easy to adapt the code to the new interface. If it proves hard, please send a snippet with your previous listening loop and we may be able to help you (see the lighthouse help if you want to post code well formatted).

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="">the new tracker</a>.
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins

People watching this ticket