From: Marcin Stępnicki <mstepnicki@gmail.com>
To: chester c young <chestercyoung@yahoo.com>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: unused columns in copy
Date: Tue, 21 Jul 2009 00:59:44 +0200
Message-ID: <179149fe0907201559x3e81028aue0b51ba317c2fbbb@mail.gmail.com> (raw)
In-Reply-To: <471945.42509.qm@web54306.mail.re2.yahoo.com>
References: <471945.42509.qm@web54306.mail.re2.yahoo.com>
On Mon, Jul 20, 2009 at 3:22 PM, chester c young<chestercyoung@yahoo.com> wrote:
>
> is there a way for COPY FROM to ignore unused columns in CSV?
>
> in other words, if table t1 has columns c1, c2, and if csv has columns c1, c3, c2, could I do something like
>
> COPY t1( c1, null, c2 ) FROM 'file.csv'
No, but you can use pgloader which can easily deal with your problem
and much more. http://pgfoundry.org/projects/pgloader/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mstepnicki@gmail.com, chestercyoung@yahoo.com
Subject: Re: unused columns in copy
In-Reply-To: <179149fe0907201559x3e81028aue0b51ba317c2fbbb@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox