COPY does not work with regproc and aclitem

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: pgsql-hackers(at)postgresql(dot)org
Subject: COPY does not work with regproc and aclitem
Date: 2006-10-23 19:43:47
Message-ID: 453D1B73.2050906@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-10-23 19:57:51 Re: COPY does not work with regproc and aclitem
Previous Message Jeremy Drake 2006-10-23 19:43:40 Re: New CRC algorithm: Slicing by 8

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-10-23 19:47:14 Re: BUG #2712: could not fsync segment: Permission
Previous Message Peter Brant 2006-10-23 19:24:25 Re: BUG #2712: could not fsync segment: Permission