From: Andrew Kuchling <akuchlin@mems-exchange.org>
To: pgsql-interfaces@postgresql.org
Subject: pgdb.py fetching same row multiple times
Date: Mon, 02 Apr 2001 16:07:00 -0400
Message-ID: <E14kAbM-0000uW-00@ute.cnri.reston.va.us> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: akuchlin@mems-exchange.org
Subject: Re: pgdb.py fetching same row multiple times
In-Reply-To: <E14kAbM-0000uW-00@ute.cnri.reston.va.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox