Re: Problem reloading regression database - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Problem reloading regression database
Date
Msg-id 25632.1010940070@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problem reloading regression database  (Brent Verner <brent@rcfile.org>)
Responses Re: Problem reloading regression database  (Brent Verner <brent@rcfile.org>)
List pgsql-hackers
Brent Verner <brent@rcfile.org> writes:
>   In CopyFrom, if attlist present, create Form_pg_attribute* ordered
>     same as attlist.

Doesn't seem like this can possibly work as-is.  The eventual call to
heap_formtuple must supply the column values in the order expected
by the table, but I don't see you remapping from input-column indices to
table-column indices anywhere in the data processing loop.

Also, a reasonable version of this capability would allow the input
column list to be just a subset of the table column list; with the
column default expressions, if any, being evaluated to fill the missing
columns.  This would answer the requests we keep having for COPY to be
able to load a table containing a serial-number column.

Don't forget that if the syntax allows COPY (collist) TO file, people
will expect that to work too.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Brent Verner
Date:
Subject: Re: Problem reloading regression database
Next
From: Peter Eisentraut
Date:
Subject: Re: mysql-pgsql comparison