pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Paul Lambert <paul.lambert@autoledgers.com.au>
To: pgsql-sql@postgresql.org
Subject: Re: Query RE using COPY
Date: Tue, 08 May 2007 10:44:21 +0800
Message-ID: <463FE405.40704@autoledgers.com.au> (raw)
In-Reply-To: <36e682920705071916l27d64129j2d3c9d296fbbd6e5@mail.gmail.com>
References: <463FD7B8.9030700@autoledgers.com.au>
<36e682920705071916l27d64129j2d3c9d296fbbd6e5@mail.gmail.com>
Jonah H. Harris wrote:
> COPY mytbl (col1, col2, col3, col4, col6) FROM 'myfile.txt' WITH
> DELIMITER AS '^' QUOTE '\f' CSV HEADER;
>
>
I would rather not do it this way as I use the same load script at all
customer sites where the extracts and requirements may vary. I.e. one
customer may not use the location field mentioned above, but another might.
What I would prefer to do, if possible, is set that column in the
database to 'not required' so that if I get an extract that doesn't have
that column in the file, the copy doesn't care.
As it stands now I generally have to drop all the unneeded columns from
numerous tables, perform my load and then re-add them back again.
When we're talking about 40 or more tables in each database some tables
with several hundred columns... your suggestion would be a bit
cumbersome - particularly if it is only one or two columns in each table
that that the client doesn't need.
--
Paul Lambert
Database Administrator
AutoLedgers
view thread (6+ messages) latest in thread
Message-ID: <463FE405.40704@autoledgers.com.au> Permalink: ../463FE405.40704@autoledgers.com.au/ Also on: postgresql.org/message-id/463FE405.40704@autoledgers.com.au ·
reply
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: paul.lambert@autoledgers.com.au Subject: Re: Query RE using COPY In-Reply-To: <463FE405.40704@autoledgers.com.au> * 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