From: Billy G. A. <bal...@wi...> - 2003-04-21 03:15:14
|
Benjamin Scherrey wrote: >The DB-API 2.0 PEP specifies an optional mechanism for handling cursors and providing forward >and backward iteration via the cursor.scroll() method. I was curious as to whether or not this was >something coming for PyPgSQL and, until then, what would be a good workaround for going >backwards in a cursor. > > many thanx, > > Ben Scherrey > Yes they will be added to pyPgSQL (If you want to supply a patch, I won't object :-) ). The cursor object has a rewind method, which will rewind the cursor back to the beginning. Your can also execute a query in the form: cursor.execute('MOVE BACKWARD XXX IN "%s"' % cursor.name) or cursor.execute('MOVE FORWARD XXX IN "%s"' % cursor.name) [If you would like to supply a patch to implement .scroll(), you can use .rewind() as a model] I hope this helps. > > |