large return resuls - Mailing list psycopg

From maplabs@light42.com
Subject large return resuls
Date
Msg-id 20120110142834.113b30useocgss4c@webmail.light42.com
Whole thread Raw
Responses Re: large return resuls  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
Hi All-

  I am just returning to a psycopg2 project after a break..
We are using 2.4.2  on Linux, python 2.7, postgres 9.1

 If I make a query that returns truly large results
that is, both a lot of data per record, and a lot of records
What is the best way to handle that ?

Right now I just declare a cursor, execute() and then

for rec in cursor.fetchall():
  .... stuff ..

on the hardware it is on, it is working fine apparently..
but it got me wondering..

fetchone()  fetchmany(..) and fetchall()
  will all basically pull the data at once, yes?

a server side cursor is the only way to bring data piece by piece, yes?

  thanks
   -Brian



psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: Use lo_creat() when possible instead of lo_create()
Next
From: Daniele Varrazzo
Date:
Subject: Re: large return resuls