Re: about client-side cursors - Mailing list psycopg

From Christophe Pettus
Subject Re: about client-side cursors
Date
Msg-id 3BA6B9FE-9A00-4F04-9C0B-263EE4301985@thebuild.com
Whole thread Raw
In response to Re: about client-side cursors  (Denis Laxalde <denis.laxalde@dalibo.com>)
Responses Re: about client-side cursors  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Re: about client-side cursors  (Denis Laxalde <denis.laxalde@dalibo.com>)
List psycopg

> On Feb 4, 2021, at 07:02, Denis Laxalde <denis.laxalde@dalibo.com> wrote:
>
> If "cursor" is a real database cursor, I agree.

But it's not just CURSORs that have this behavior.  libpq allows the client to the send the query, and then make
separaterequests for each row, even without a database cursor; this maps almost exactly to .execute() and .fetchone().
Itdoesn't seem a good idea to guarantee forever that .execute() will *never* do I/O without a database-side cursor. 

Having a single convenience method on the connection object that does the equivalent of a .execute() and a .fetchall()
mightbe useful, though. 
--
-- Christophe Pettus
   xof@thebuild.com




psycopg by date:

Previous
From: Denis Laxalde
Date:
Subject: Re: about client-side cursors
Next
From: Daniele Varrazzo
Date:
Subject: Re: about client-side cursors