COPY does not work with regproc and aclitem

Поиск
Список
Период
Сортировка
От Zdenek Kotala
Тема COPY does not work with regproc and aclitem
Дата
Msg-id 453D1B73.2050906@sun.com
обсуждение исходный текст
Ответы Re: COPY does not work with regproc and aclitem  (Andrew Dunstan <andrew@dunslane.net>)
Re: COPY does not work with regproc and aclitem  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeremy Drake
Дата:
Сообщение: Re: New CRC algorithm: Slicing by 8
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: COPY does not work with regproc and aclitem