Skip site navigation (1) Skip section navigation (2)

Re: Import csv file into multiple tables in Postgres

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Deepblues <deepblues(at)gmail(dot)com>
Cc: KeithW(at)narrowpathinc(dot)com, pgsql-novice(at)postgresql(dot)org
Subject: Re: Import csv file into multiple tables in Postgres
Date: 2005-03-04 15:11:46
Message-ID: 20050304151146.GA19477@wolff.to (view raw or flat)
Thread:
Lists: pgsql-novice
On Thu, Mar 03, 2005 at 14:10:58 -0600,
  Deepblues <deepblues(at)gmail(dot)com> wrote:
> Thanks for all that information, My scenario looks like this ...
> 
>  I need to import an excel spreadsheet into the postgresql database .
> I converted the excel spreadsheet into a csv file and now I have 3
> tables in my database where I need to import this data. Im new to both
> perl and postgres. do you have any sample script that I can have a
> look at which loads the csv file into a interface table ?

If you are using 8.0, you should be able to use COPY (or /copy from psql)
to read in the files with one copy command per file. If there are no
quoted values in the csv files, then you can do this on older versions
of Postgres.

In response to

pgsql-novice by date

Next:From: Bruno Wolff IIIDate: 2005-03-04 15:16:56
Subject: Re: Form Design Advice
Previous:From: Keith WorthingtonDate: 2005-03-04 15:00:27
Subject: Re: Help on Trigger functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group