pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zdenek Kotala <Zdenek.Kotala@Sun.COM>
To: pgsql-hackers@postgresql.org
Subject: COPY does not work with regproc and aclitem
Date: Mon, 23 Oct 2006 21:43:47 +0200
Message-ID: <453D1B73.2050906@sun.com> (raw)

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



view thread (18+ messages)  latest in thread

Message-ID: <453D1B73.2050906@sun.com>
Permalink:  ../453D1B73.2050906@sun.com/
Also on:    postgresql.org/message-id/453D1B73.2050906@sun.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: Zdenek.Kotala@Sun.COM
  Subject: Re: COPY does not work with regproc and aclitem
  In-Reply-To: <453D1B73.2050906@sun.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox