Re: COPY does not work with regproc and aclitem - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: COPY does not work with regproc and aclitem
Date
Msg-id 20061023201322.GE11409@alvh.no-ip.org
Whole thread Raw
In response to Re: COPY does not work with regproc and aclitem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> 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.

I was thinking in the copied-out table, which not necessarily has to be
pg_aggregate.  I just tried, and it works to do this:

alvherre=# create table pg_aggregate2 (aggfnoid regprocedure, aggtransfn
alvherre(# regprocedure, aggfinalfn regprocedure, aggsortop oid, aggtranstype oid,
alvherre(# agginitval text);
CREATE TABLE
alvherre=# insert into pg_aggregate2 select * from pg_aggregate;
INSERT 0 114
alvherre=# create table test (like pg_aggregate2);
CREATE TABLE
alvherre=# copy pg_aggregate2 to '/tmp/pg_agg.out';
COPY 114
alvherre=# copy test from '/tmp/pg_agg.out';
COPY 114
alvherre=# 

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY does not work with regproc and aclitem
Next
From: Andrew Dunstan
Date:
Subject: Re: COPY does not work with regproc and aclitem