Re: Importing into Postgres from a csv file

From: "Roderick A(dot) Anderson" <raanders(at)altoplanos(dot)net>
To: "PostgreSQL::General List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Importing into Postgres from a csv file
Date: 2000-08-24 16:05:36
Message-ID: Pine.LNX.4.04.10008240857481.29855-100000@asgard.altoplanos.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 24 Aug 2000, John McKown wrote:

> I think that you can do this using the COPY verb in psql.
>
> COPY table FROM file USING DELIMITERS ',';

Be aware you will probably have to start psql as the postgres (superuser)
to use the COPY command.

But ... the \copy version is usable by normal users.

Spent the best part of this morning playing with it. Testing - stress
testing - my system and PostgreSQL. Importing 187 files of approx.
150,000 records with 4 fields (float4, float4, float4, interger).

Was taking about 8 seconds per file on a PII/350 w/ 256 MByte RAM.

Hope my partition survives the process (system's at home) since it was
only 2 GByte with 1% used.

Rod
--
Roderick A. Anderson
raanders(at)altoplanos(dot)net Altoplanos Information Systems, Inc.
Voice: 208.765.6149 212 S. 11th Street, Suite 5
FAX: 208.664.5299 Coeur d'Alene, ID 83814

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Mount 2000-08-24 17:02:39 Re: JDBC
Previous Message Ross J. Reedstrom 2000-08-24 15:44:26 Re: FW: Count & Distinct