Re: Load a csv file into a pgsql table

From: Steve Atkins <steve(at)blighty(dot)com>
To: PgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Load a csv file into a pgsql table
Date: 2006-09-19 18:26:42
Message-ID: D8530D65-F9BB-4AFC-A8E1-F516536A4FBE@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brandon Aiken 2006-09-19 18:27:40 Re: Load a csv file into a pgsql table
Previous Message Emi Lu 2006-09-19 18:15:22 Load a csv file into a pgsql table