Re: Import csv

From: terry(at)greatgulfhomes(dot)com
To: "'Patrick Nelson'" <pnelson(at)neatech(dot)com>, "'PostgreSQL List (E-mail)'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Import csv
Date: 2002-07-26 17:46:46
Message-ID: 000801c234cc$69fdab00$2766f30a@development.greatgulfhomes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

devtest2=# \h copy
Command: COPY
Description: copy data between files and tables
Syntax:
COPY [ BINARY ] table [ WITH OIDS ]
FROM { 'filename' | stdin }
[ [USING] DELIMITERS 'delimiter' ]
[ WITH NULL AS 'null string' ]
COPY [ BINARY ] table [ WITH OIDS ]
TO { 'filename' | stdout }
[ [USING] DELIMITERS 'delimiter' ]
[ WITH NULL AS 'null string' ]

Hence

COPY t1 FROM '<filename>' USING DELIMITERS ',';

Terry Fielder
Network Engineer
Great Gulf Homes / Ashton Woods Homes
terry(at)greatgulfhomes(dot)com

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Patrick Nelson
> Sent: Friday, July 26, 2002 1:45 PM
> To: PostgreSQL List (E-mail)
> Subject: [GENERAL] Import csv
>
>
> I'm away from my PostgreSQL book (me SQL bible) and I'm faced
> with importing
> csv (comma separated vales) file where I had setup all my
> scripts to tsv
> (tab separated vales). Yes I can use an editor, as such and
> change the
> commas, but that's not the question.
>
> How do I take a basic csv file and insert it into my table (named
> dwnldstockanal)? Just feel that this is something that I
> should know, but
> me scratches me head.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo(at)postgresql(dot)org)
>

In response to

  • Import csv at 2002-07-26 17:45:24 from Patrick Nelson

Browse pgsql-general by date

  From Date Subject
Next Message Roderick A. Anderson 2002-07-26 17:51:57 Re: Advice on geolocation
Previous Message Patrick Nelson 2002-07-26 17:45:24 Import csv