Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1F7259FB33B for ; Mon, 23 Oct 2006 17:20:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 06424-04 for ; Mon, 23 Oct 2006 17:20:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from gmp-ea-fw-1.sun.com (gmp-ea-fw-1.sun.com [192.18.1.36]) by postgresql.org (Postfix) with ESMTP id 2A8259FB3F2 for ; Mon, 23 Oct 2006 17:20:15 -0300 (ADT) Received: from d1-emea-09.sun.com ([192.18.2.119]) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k9NKKEs9024782 for ; Mon, 23 Oct 2006 21:20:14 +0100 (BST) Received: from conversion-daemon.d1-emea-09.sun.com by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0J7L00801V3LV300@d1-emea-09.sun.com> (original mail from Zdenek.Kotala@Sun.COM) for pgsql-hackers@postgresql.org; Mon, 23 Oct 2006 21:20:14 +0100 (BST) Received: from [129.150.120.213] by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0J7L00E2TV5PO8GQ@d1-emea-09.sun.com>; Mon, 23 Oct 2006 21:20:14 +0100 (BST) Date: Mon, 23 Oct 2006 22:16:36 +0200 From: Zdenek Kotala Subject: Re: COPY does not work with regproc and aclitem In-reply-to: <27990.1161634170@sss.pgh.pa.us> To: Tom Lane Cc: Alvaro Herrera , pgsql-hackers@postgresql.org Message-id: <453D2324.2090901@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <453D1B73.2050906@sun.com> <20061023200200.GD11409@alvh.no-ip.org> <27990.1161634170@sss.pgh.pa.us> User-Agent: Mail/News 1.5 (X11/20051211) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.087 tagged_above=0 required=5 tests=AWL, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL, UNPARSEABLE_RELAY X-Spam-Level: ** X-Archive-Number: 200610/1240 X-Sequence-Number: 93137 Tom Lane wrote: > Alvaro Herrera writes: >> Hmm, maybe it should be using regprocedure instead? > > Not unless you want to break initdb. The only reason regproc still > exists, really, is to accommodate loading of pg_type during initdb. > Guess what: we can't do type lookup at that point. Do you mean something like this: Datum regprocout(PG_FUNCTION_ARGS) { ... if( donot_resolve_procname == TRUE) { result = (char *) palloc(NAMEDATALEN); snprintf(result, NAMEDATALEN, "%u", proid); } ... PG_RETURN_CSTRING(result); } donot_resolve_procname will be set when COPY will be performed. Zdenek