COPY, but not everything... - Mailing list pgsql-general

From Ian Harding
Subject COPY, but not everything...
Date
Msg-id sef8391c.078@mail.tpchd.org
Whole thread Raw
List pgsql-general
I have a big ascii text file that I would only like to import columns 1, 3 and 7 from.  I know I can filter it through
cut,but I wonder if there is an undocumented way to do it with COPY.  Sybase has a useless function called filler()
thatyou use for fields you want to ignore.  For example (psuedocode...) 

COPY mytable (col1, filler(), filler(), col2, filler(), col3) FROM '/tmp/foobar';

I like the new functionality allowing me to ignore columns in the target table, and to rearrange the columns, but this
functionalityseems to be missing... (Or I am reading it wrong...) 

Thanks!

Ian Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
iharding@tpchd.org
Phone: (253) 798-3549
Pager: (253) 754-0002



pgsql-general by date:

Previous
From: Paul Ramsey
Date:
Subject: Re: Failure to install 7.3.3
Next
From: Alan Williams
Date:
Subject: Re: Inheritance & Indexes