From: Gerhard <ger...@gm...> - 2002-06-09 11:27:03
|
* Gerhard Häring <ger...@gm...> [2002-06-07 20:35 +0200]: > In a current project, I needed to wrap the PostgreSQL SQL extension MOVE > FORWARD/BACKWARD to move in server-side cursors. I'd suggest to add the > following method to the Cursor class: > > def move(self, howmany) It think better to implement the optional DB-API extension Cursor Method .scroll(value[,mode='relative']) from PEP 0249. > One other thing for the PostgreSQL experts (ehem): am I correct that > there is no way of knowing how many rows a cursor contains? Is it really > the easiest solution to first do a SELECT COUNT on the same query? Looks like so, but in the end I was able to do without knowing the total number of rows. Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930 public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) |