Re: Need help doing a CSV import - Mailing list pgsql-general

From Tim Landscheidt
Subject Re: Need help doing a CSV import
Date
Msg-id m3hbk1hom8.fsf@passepartout.tim-landscheidt.de
Whole thread Raw
In response to Need help doing a CSV import  (tony@exquisiteimages.com)
List pgsql-general
David Fetter <david@fetter.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

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: How to Declare Functions Containing OUT PArameters?
Next
From: Tom Lane
Date:
Subject: Re: How to Declare Functions Containing OUT PArameters?