Re: plpgsql arrays - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: plpgsql arrays
Date
Msg-id b42b73150904071224i40caed89w1da7394c072ef9ec@mail.gmail.com
Whole thread Raw
In response to Re: plpgsql arrays  (Matthew Wakeling <matthew@flymine.org>)
Responses Re: plpgsql arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
On Tue, Apr 7, 2009 at 11:18 AM, Matthew Wakeling <matthew@flymine.org> wrote:
> On Fri, 3 Apr 2009, Tom Lane wrote:
>>>
>>> ... alternatively is there a way to read two results streams
>>> simultaneously?
>>
>> Use two cursors and FETCH from each as needed?  In recent releases you
>> can even scroll backwards, which you're going to need to do to make
>> a merge join work.
>
> What would be the syntax for putting a single row from a cursor into a
> variable? I have tried:
>
> FETCH INTO left left_cursor;

according to the docs,

 Examples:

FETCH curs1 INTO rowvar;
FETCH curs2 INTO foo, bar, baz;
FETCH LAST FROM curs3 INTO x, y;
FETCH RELATIVE -2 FROM curs4 INTO x;

http://www.postgresql.org/docs/8.3/interactive/plpgsql-cursors.html#PLPGSQL-CURSOR-USING

merlin

pgsql-performance by date:

Previous
From: Brian Cox
Date:
Subject: determining the locks that will be held by a query
Next
From: Tom Lane
Date:
Subject: Re: plpgsql arrays