Skip site navigation (1) Skip section navigation (2) fetching same row multiple times

From: Andrew Kuchling <akuchlin(at)mems-exchange(dot)org>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: fetching same row multiple times
Date: 2001-04-02 20:07:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
With the 7.1RC1 code, plus two unrelated fixes to that are in
the CVS, the .fetch() method of pgdbCursor always returns the first
row, not each successive row.  For example, this test program:

import pgdb
db = pgdb.connect('')

c = db.cursor()
c.execute('select * from fab_providers')
print c.fetchone()
print c.fetchone()

will print the same row twice:

ute akuchlin>python /tmp/
['CNF', 'Cornell Nanofabrication Facility', ... ]
['CNF', 'Cornell Nanofabrication Facility', ... ]
ute akuchlin>

The first column is a primary key, so the table doesn't actually
contain two duplicate rows.  

Has anyone else noted this?  Anyone have a fix?

(Note that this doesn't apply to the basic interface implemented by
pgmodule.c; the problem is only with the wrapper to provide a
DB-API interface.)


pgsql-interfaces by date

Next:From: Jerry AsherDate: 2001-04-03 00:16:11
Subject: trouble finding the object method driver....
Previous:From: László TiborDate: 2001-04-02 09:45:56
Subject: RE: connect to MS SQL server

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group