Re: Cursor Example Needed

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Perry Smith <pedzsan(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cursor Example Needed
Date: 2013-10-28 21:11:24
Message-ID: CAHyXU0zwXsVwK9XVyfsEPmD+vPH-0Fo32j+diFf83HWUupvB-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 28, 2013 at 4:06 PM, Perry Smith <pedzsan(at)gmail(dot)com> wrote:
> When I execute the SELECT statement directly I get:
>
> psql:table.sql:28: out of memory for query result

psql will do this automatically if you tell it to:
http://doginpool.blogspot.com/2011/11/retrieving-large-resultsets-from.html

cursors can work with your code, but they need participation from the
client side. basically you stage the cursor then repeatedly FETCH
until done.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Perry Smith 2013-10-28 21:27:53 Re: Cursor Example Needed
Previous Message Herouth Maoz 2013-10-28 21:07:19 Re: Table partitioning