Jeff Eckermann <jeff_eckermann@yahoo.com> writes:
> I believe that soon-to-be-released version 7.3 will
> have the ability to import data to specific columns,
> as you are trying to do. For now, you will have to
> edit your input file to insert values (even if null)
> for the missing columns.
A usually-easier way is to make a temp table that matches the column
format of the source file, COPY into that, and then doINSERT INTO finaltable SELECT foo,bar,... FROM temptable
In the INSERT/SELECT it's trivial to do any rearrangement you want.
7.3 will add some more flexibility to COPY, but it only saves a
step, doesn't really do anything you can't do with a temp table.
regards, tom lane