Re: Load a csv file into a pgsql table - Mailing list pgsql-general

From Steve Atkins
Subject Re: Load a csv file into a pgsql table
Date
Msg-id D8530D65-F9BB-4AFC-A8E1-F516536A4FBE@blighty.com
Whole thread Raw
In response to Load a csv file into a pgsql table  (Emi Lu <emilu@encs.concordia.ca>)
Responses Re: Load a csv file into a pgsql table
List pgsql-general
On Sep 19, 2006, at 11:15 AM, Emi Lu wrote:

> Greetings,
>
>
> *Except* copy command, are there other quick ways to load data from
> a csv file into a pgsql table please?

There are several bulk loaders, but I believe they all use COPY
behind the scenes.

If copy isn't an option then your best bet will be many inserts in a
transaction, but that'll be significantly slower. You could cobble
together a loader using perl, DBI and one of the CPAN CSV modules
fairly easily.

(But I can't think of any reason why you wouldn't use copy, so you
must have some constraint you haven't mentioned - can you expand on
why copy isn't an option?)

Cheers,
   Steve


pgsql-general by date:

Previous
From: "Brandon Aiken"
Date:
Subject: Re: Load a csv file into a pgsql table
Next
From: Scott Marlowe
Date:
Subject: Re: Load a csv file into a pgsql table