populating postgresql from tab-delimited text file

From: ksprague(at)NRCan(dot)gc(dot)ca
To: pgsql-novice(at)postgresql(dot)org
Subject: populating postgresql from tab-delimited text file
Date: 2001-09-17 19:33:31
Message-ID: 3BA6500B.87BFE452@NRCan.gc.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

What is quickest and dirtiest way to load the contents of a
tab-delimited text file into a postgresql database?

I would like to do this with a batch file that expects certain specified
fields from the data text file (fields may belong to different tables).
Speed is also an issue -- I fear that repeated INSERT commands may be
too slow.

I thought of writing an sql statement file and then using the -f option,
but I would rather skip having to create an intermediate file and do the
insertions directly.

Has anyone done this? Any example shell code...using COPY command
perhaps? :>

Regards,
Kevin

Browse pgsql-novice by date

  From Date Subject
Next Message Vijay Deval 2001-09-18 03:27:14 Re: Out of memory error
Previous Message Tom Lane 2001-09-17 14:45:20 Re: Out of memory error