Re: COPY does not work with regproc and aclitem

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY does not work with regproc and aclitem
Date: 2006-10-23 20:13:22
Message-ID: 20061023201322.GE11409@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2006-10-23 20:16:36 Re: COPY does not work with regproc and aclitem
Previous Message Tom Lane 2006-10-23 20:09:30 Re: COPY does not work with regproc and aclitem

Browse pgsql-patches by date

  From Date Subject
Next Message Zdenek Kotala 2006-10-23 20:16:36 Re: COPY does not work with regproc and aclitem
Previous Message Tom Lane 2006-10-23 20:09:30 Re: COPY does not work with regproc and aclitem