This project is archived and is in readonly mode.
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 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 usingcur.connection.fileno()
.Listening for notify whould be easier than it was before 2.2: use
connection.poll()
and check if there is anything new innotifies
. More efficient than continuous polling, you can useconn.fileno()
in a wait facility such asselect()
and only poll when there is something to read. There is no more need forisready()
: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="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
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.