Re: Need help doing a CSV import

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Need help doing a CSV import
Date: 2010-07-14 19:03:59
Message-ID: m3hbk1hom8.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Fetter <david(at)fetter(dot)org> wrote:

> [...]
>> Another option is a small Perl script or something similar
>> that connects to both the FoxPro and the PostgreSQL database
>> and transfers the data with parameterized "INSERT". The ad-
>> vantage of this is that you have tight control of charsets,
>> date formats, EOL conventions & Co. and do not have to won-
>> der whether this and that file is in this and that stage of
>> the conversion process, the disadvantage is obviously that
>> you lose any speed benefit of bulk "COPY".

> You can do your transformations and hand the stream off to the COPY
> interface. See the pg_putcopydata() section of the DBD::Pg manual for
> examples. :)

Eh, yes, but then you have to do all the escaping yourself
and the simplicity of "get values A, B, C from this connec-
tion and pass it onto that" goes away :-). Now if there'd be
a "pg_putcopydata(array of arrayrefs)" ... :-).

Tim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-07-14 19:16:04 Re: How to Declare Functions Containing OUT PArameters?
Previous Message Joshua D. Drake 2010-07-14 18:51:31 Re: How to Declare Functions Containing OUT PArameters?