moving CSV data into table?

From: James Hartley <jjhartley(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: moving CSV data into table?
Date: 2011-09-02 17:08:21
Message-ID: CAKeNXXt=Cj66LRRJmC6eXJeKnPY-=NDLsCQqpDbkc2bbVmkUSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I need to ask about best practices. I now have periodic bulk CSV data
needing to be added to an existing table. I assume it is best to first move
the data into a temporary table & scrub it before moving into the final
table. However, the incoming data does not have the same schema as the
permanent target as additional attributes (columns) have been added. Is it
better to massage the temporary table into the same target's schema first, &
use COPY to copy all temporary contents into the permanent table, or is
scripting a better solution? Is there a better method?

Your insights would be appreciated.

Thanks.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Steve Crawford 2011-09-02 18:16:15 Re: moving CSV data into table?
Previous Message Chris Campbell 2011-09-02 15:11:09 Re: Automated pg_Dump issue