Received: from ute.cnri.reston.va.us (cnri170.cnri.reston.va.us [132.151.1.170]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f32K73K39913 for ; Mon, 2 Apr 2001 16:07:03 -0400 (EDT) (envelope-from akuchlin@mems-exchange.org) Received: from akuchlin by ute.cnri.reston.va.us with local (Exim 3.20 #1) id 14kAbM-0000uW-00 for pgsql-interfaces@postgresql.org; Mon, 02 Apr 2001 16:07:00 -0400 From: Andrew Kuchling To: pgsql-interfaces@postgresql.org Subject: pgdb.py fetching same row multiple times Reply-to: akuchlin@mems-exchange.org Message-Id: Date: Mon, 02 Apr 2001 16:07:00 -0400 X-Archive-Number: 200104/3 X-Sequence-Number: 1386 With the 7.1RC1 code, plus two unrelated fixes to pgdb.py 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('ute.cnri.reston.va.us:mems:akuchlin') c = db.cursor() c.execute('select * from fab_providers') print c.fetchone() print c.fetchone() db.close() will print the same row twice: ute akuchlin>python /tmp/t.py ['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 pgdb.py wrapper to provide a DB-API interface.) --amk