Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8851A632886 for ; Tue, 7 Apr 2009 16:24:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41046-05 for ; Tue, 7 Apr 2009 16:24:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by mail.postgresql.org (Postfix) with ESMTP id CC45F6330D0 for ; Tue, 7 Apr 2009 16:24:25 -0300 (ADT) Received: by bwz17 with SMTP id 17so4315725bwz.19 for ; Tue, 07 Apr 2009 12:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=rkdgbNER1ZHJBRyDUuh1ZyBlE7Nqfn2S/Ad/j1Yomms=; b=ndzjeW9KwuX2R8/7XoJMYoXy8WsJfBkGojnq73Ue+EABLZYM1R6hEn3w5DMZpoHm1H 0wC/w1G5dDJ9Bly2ffaWVjqrWM+evmUkE9ATrP8FTVCUl8Nod4DjkAEaV32chV9Vyixd 5S4lozaaRk4lq9Pj8DN+cRl3QIOsP2fc0oqRI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=hT3YJeBoTfoWHXbrmPBDtCH8YoCnntMgWcPNpdXQHzMtMTiE/itCvUcXNSnNR4rlks +HGokrDtLQWNjRo1hoV/J2U7tvemmZ9+E5JYbjufegEo71W6RHXZN0ntw0wYvJ8JrUzq 41ZXmPhUf9cWHBD8tNxPmRVk15BBnnpNwGSbs= MIME-Version: 1.0 Received: by 10.103.229.12 with SMTP id g12mr112163mur.87.1239132264050; Tue, 07 Apr 2009 12:24:24 -0700 (PDT) In-Reply-To: References: <28757.1238767715@sss.pgh.pa.us> Date: Tue, 7 Apr 2009 15:24:23 -0400 Message-ID: Subject: Re: plpgsql arrays From: Merlin Moncure To: Matthew Wakeling Cc: Tom Lane , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/148 X-Sequence-Number: 33515 On Tue, Apr 7, 2009 at 11:18 AM, Matthew Wakeling wro= te: > 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? =A0In 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