Re: using copy to insert data. - Mailing list pgsql-novice

From Andrew McMillan
Subject Re: using copy to insert data.
Date
Msg-id 1044554651.2940.11.camel@kant.mcmillan.net.nz
Whole thread Raw
In response to using copy to insert data.  ("Jennifer Lee" <jlee@scri.sari.ac.uk>)
List pgsql-novice
On Fri, 2003-02-07 at 05:40, Jennifer Lee wrote:
> I'm trying to insert data from a delimited file using the copy command
> (COPY table FROM 'filepath') this works fine, but I would like to insert
> data into specific columns. I've read that this is possible but haven't
> been able to find documentation on how to do it. I've been able to
> insert the data as I'd like in two steps. 1. copy into a temporary table, 2.
> insert using select columns from the temporary table. Is there a way to
> do this in one step?

COPY table (column1, column2, column3 ) FROM ....

According to the docs it works in 7.3 but I have never had cause to use
that syntax myself.

Regards,
                    Andrew.
--
---------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/         PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201     MOB: +64(21)635-694    OFFICE: +64(4)499-2267
           Survey for nothing with http://survey.net.nz/
---------------------------------------------------------------------


pgsql-novice by date:

Previous
From: Andrew McMillan
Date:
Subject: Re: Html output
Next
From: Steve Crawford
Date:
Subject: Re: Favorite Linux Editor for PostgreSQL Scripts?