#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

Hello,
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”

    Hello,

    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).

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

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

Pages