Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2D7DA638274 for ; Fri, 3 Apr 2009 10:47:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 25872-03 for ; Fri, 3 Apr 2009 10:47:25 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by mail.postgresql.org (Postfix) with ESMTP id 966356381C6 for ; Fri, 3 Apr 2009 10:47:33 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 3so704955ywj.73 for ; Fri, 03 Apr 2009 06:47:32 -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=AEsArR+N4ZrmYRQerueWr5lYQ9VadtT7cs/PBWdcqRY=; b=VFsVNisUhcnsd6owsmd7Ij9TxUl2hAo1QTiCS8WsDOumJoIyQMQ+AgRbTUHiqdHjpv GtHyoH77sobk9mhqnkPZDYdeu+1NinuK5u+a6nlUingu7VDYIQe69ItL9+C5VWBgQtI0 0AGD14LltIrb6wSCKy3ExzV/nh/GHLFjfdoMA= 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=apfO3ntCC86Cs/wbyplzZAdy7v7CcutTJvJkc1rvDB4rJRTnN2y9OTpKMnX78iVy07 naaXLAzgtRmOX6LKApjfppz29bEz8ZYsHlan4RjE3AwIRiTpeg1Dk1kyxd71GKhpVFjN zFec1q6HQ+ymxSnXkGiWT6aHhr4dDB3pH0O54= MIME-Version: 1.0 Received: by 10.100.108.2 with SMTP id g2mr1581583anc.78.1238766452075; Fri, 03 Apr 2009 06:47:32 -0700 (PDT) In-Reply-To: References: Date: Fri, 3 Apr 2009 09:47:31 -0400 Message-ID: <603c8f070904030647u1c92e13ew53612ac0011ed7c1@mail.gmail.com> Subject: Re: plpgsql arrays From: Robert Haas To: Matthew Wakeling Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.141 tagged_above=0 required=5 tests=AWL=0.141 X-Spam-Level: X-Archive-Number: 200904/60 X-Sequence-Number: 33427 On Fri, Apr 3, 2009 at 9:32 AM, Matthew Wakeling wrote: > I'm writing a plpgsql function that effectively does a merge join on the > results of two queries. Now, it appears that I cannot read the results of > two queries as streams in plpgsql, so I need to copy the contents of one > query into an array first, and then iterate over the second query > afterwards. Why not just use SQL to do the join? ...Robert