Re: Cursor Example Needed - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Cursor Example Needed
Date
Msg-id 526EE36B.1030302@gmail.com
Whole thread Raw
In response to Re: Cursor Example Needed  (Perry Smith <pedzsan@gmail.com>)
Responses Re: Cursor Example Needed
List pgsql-general
On 10/28/2013 02:27 PM, Perry Smith wrote:
>
> On Oct 28, 2013, at 4:11 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>
>> On Mon, Oct 28, 2013 at 4:06 PM, Perry Smith <pedzsan@gmail.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.
>
> Ok.  I'll try that.  I'm still curious how to do it using cursors if anyone wants
> to provide a sample.

http://www.postgresql.org/docs/9.3/interactive/sql-fetch.html

>
> Thank you,
> Perry
>


--
Adrian Klaver
adrian.klaver@gmail.com


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_dump of only range of tables
Next
From: Perry Smith
Date:
Subject: Re: Cursor Example Needed