fetchone vs. fetchmany with pygres...

From: gb(at)a3design(dot)de
To: pgsql-general(at)postgresql(dot)org
Subject: fetchone vs. fetchmany with pygres...
Date: 2000-12-07 15:07:56
Message-ID: Pine.LNX.4.21.0012071601590.367-100000@firebird.mipz.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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 imagine
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 to
get the next result-row?

yours
gunter

Browse pgsql-general by date

  From Date Subject
Next Message Roelof van Zwol 2000-12-07 15:21:57 URL extensie
Previous Message Juriy Goloveshkin 2000-12-07 14:57:15 ilike and --enable-multibyte=KOI8