Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 55863B5DE98 for ; Mon, 26 Sep 2011 11:43:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 62344-02-7 for ; Mon, 26 Sep 2011 14:43:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B68FFB5E00C for ; Mon, 26 Sep 2011 11:33:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8QEX323005876; Mon, 26 Sep 2011 10:33:03 -0400 (EDT) To: Robert Haas cc: Ramanujam , pgsql-bugs@postgresql.org Subject: Re: BUG #6213: COPY does not work as expected in a plpgsql function In-reply-to: References: <201109190255.p8J2tAX0011023@wwwmaster.postgresql.org> Comments: In-reply-to Robert Haas message dated "Mon, 26 Sep 2011 09:40:46 -0400" Date: Mon, 26 Sep 2011 10:33:03 -0400 Message-ID: <5875.1317047583@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/171 X-Sequence-Number: 31188 Robert Haas writes: > It would actually be nice if worked even without that, but I'm not > sure what would be involved in making that happen. I've been too busy to look at this in detail, but I imagine the issue is failure to pass parameters down from the ProcessUtility call to COPY into the parsing/execution of the sub-SELECT. It might be relatively straightforward to fix, or then again it might not. The parsing end of it could quite likely be harder than the execution end. We've surmounted similar issues in places like EXPLAIN, though. regards, tom lane