fetchone vs. fetchmany with pygres...

gunter gb at a3design.de
Fri Dec 8 02:44:17 EST 2000

Hello there!

I am using pygres (postgres-python-interface).

There are two functions for cursors:

cursor.fetchone(): returns one result-row.
cursor.fetchmany(): returns all result-rows.

the problem:
multiple calls of "fetchone" return the same data every call. (It
seems to
be written for "non-table-returns" only)
the call of "fetchmany" returns a list of all rows. This is ok but
a very large return-set. You have the whole return-set in the memory
instead of every line one by one.

Is there a solution with something like "fetchone" but with every call
get the next result-row?


More information about the Python-list mailing list