On Mon, Oct 28, 2013 at 9:28 PM, Damiano Albani
<damiano.albani@gmail.com> wrote:
> But what is the reason why Psycopg needs memory to just run a query, without
> fetching results?
Because the result is returned to the client as the response for the
query and is stored inside the cursor. fetch*() only return it to
Python.
The behaviour of actually getting the result on fetch*() is obtained
using a server-side cursor. The price you pay is more network
roundtrips and more resources used by the server.
-- Daniele