pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: P.J. \"Josh\" Rovero <rovero@sonalysts.com>
To: Dave [Hawk-Systems] <dave@hawk-systems.com>
Cc: pgsql-general@postgresql.org
Subject: Re: populate table with large csv file
Date: Thu, 25 Sep 2003 12:50:56 -0400
Message-ID: <3F731CF0.2090800@sonalysts.com> (raw)
In-Reply-To: <DBEIKNMKGOBGNDHAAKGNEEFEFBAC.dave@hawk-systems.com>
References: <DBEIKNMKGOBGNDHAAKGNEEFEFBAC.dave@hawk-systems.com>

Dave [Hawk-Systems] wrote:

> aside from parsing the csv file through a PHP interface, what isthe easiest way
> to get that csv data importted into the postgres database. thoughts?

Assuming the CSV file data is well formed, use psql and
the COPY command.

In psql, create the table.  Then issue command:

copy <tablename> from 'filename' using delimiters ',';
-- 
P. J. "Josh" Rovero                                 Sonalysts, Inc.
Email: rovero@sonalysts.com    www.sonalysts.com    215 Parkway North
Work: (860)326-3671 or 442-4355                     Waterford CT 06385
***********************************************************************




view thread (6+ messages)  latest in thread

Message-ID: <3F731CF0.2090800@sonalysts.com>
Permalink:  ../3F731CF0.2090800@sonalysts.com/
Also on:    postgresql.org/message-id/3F731CF0.2090800@sonalysts.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: rovero@sonalysts.com, dave@hawk-systems.com, pgsql-general@postgresql.org
  Subject: Re: populate table with large csv file
  In-Reply-To: <3F731CF0.2090800@sonalysts.com>
  References: <DBEIKNMKGOBGNDHAAKGNEEFEFBAC.dave@hawk-systems.com> <3F731CF0.2090800@sonalysts.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox