Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C6A639FB2DB for ; Mon, 23 Oct 2006 16:47:48 -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 94382-05 for ; Mon, 23 Oct 2006 16:47:32 -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 2F9D49FB335 for ; Mon, 23 Oct 2006 16:47:31 -0300 (ADT) Received: from d1-emea-09.sun.com (d1-emea-09.sun.com [192.18.2.119] (may be forged)) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k9NJlUAc001602 for ; Mon, 23 Oct 2006 20:47:30 +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 <0J7L00901TLR4A00@d1-emea-09.sun.com> (original mail from Zdenek.Kotala@Sun.COM) for pgsql-hackers@postgresql.org; Mon, 23 Oct 2006 20:47:30 +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 <0J7L00JV6TN5MMC9@d1-emea-09.sun.com> for pgsql-hackers@postgresql.org; Mon, 23 Oct 2006 20:47:30 +0100 (BST) Date: Mon, 23 Oct 2006 21:43:47 +0200 From: Zdenek Kotala Subject: COPY does not work with regproc and aclitem To: pgsql-hackers@postgresql.org Message-id: <453D1B73.2050906@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT User-Agent: Mail/News 1.5 (X11/20051211) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.947 tagged_above=0 required=5 tests=AWL, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL, UNPARSEABLE_RELAY X-Spam-Level: * X-Archive-Number: 200610/1233 X-Sequence-Number: 93130 I tried to use COPY command to export and import tables from catalog, but COPY command has problem with data type regproc. See example create table test (like pg_aggregate); copy pg_aggregate to '/tmp/pg_agg.out'; copy test from '/tmp/pg_agg.out'; ERROR: more than one function named "pg_catalog.avg" CONTEXT: COPY test, line 1, column aggfnoid: "pg_catalog.avg" The problem is that pg_proc table has following unique indexes: "pg_proc_oid_index" UNIQUE, btree (oid) "pg_proc_proname_args_nsp_index" UNIQUE, btree (proname, proargtypes, pronamespace) And regprocin in the backend/utils/adt/regproc.c cannot found unique OID for proname. Workaround is use binary mode, but on other side aclitem is not supported in the binary mode. postgres=# copy pg_class to '/tmp/pg_class.out' binary; ERROR: no binary output function available for type aclitem The solution is that COPY command will be use OID instead procname for export regproc. Zdenek