Re: plpgsql arrays

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Matthew Wakeling <matthew(at)flymine(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org
Subject: Re: plpgsql arrays
Date: 2009-04-07 19:24:23
Message-ID: b42b73150904071224i40caed89w1da7394c072ef9ec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Apr 7, 2009 at 11:18 AM, Matthew Wakeling <matthew(at)flymine(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-04-07 19:31:55 Re: plpgsql arrays
Previous Message Brian Cox 2009-04-07 18:05:29 determining the locks that will be held by a query