populating postgresql from tab-delimited text file - Mailing list pgsql-novice

From ksprague@NRCan.gc.ca
Subject populating postgresql from tab-delimited text file
Date
Msg-id 3BA6500B.87BFE452@NRCan.gc.ca
Whole thread Raw
List 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

pgsql-novice by date:

Previous
From: "ericnielsen@pop.ne.mediaone.net"
Date:
Subject: JOINs in FROM...
Next
From: ksprague@NRCan.gc.ca
Date:
Subject: populating postgresql from tab-delimited text file