COPY command - CSV files - Mailing list pgsql-hackers

From Umberto Zappi
Subject COPY command - CSV files
Date
Msg-id 40950DC7.4070609@inwind.it
Whole thread Raw
Responses Re: COPY command - CSV files  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: COPY command - CSV files  (Bruno Wolff III <bruno@wolff.to>)
Re: COPY command - CSV files  (Andrew Dunstan <andrew@dunslane.net>)
Re: COPY command - CSV files  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Re: COPY command - CSV files  (Umberto Zappi <uzappi@inwind.it>)
List pgsql-hackers
I wish modify COPY command for support of CSV files (dump/load files in
CSV format).
I think this option is very important from import data from spreedsheet
as OpenOffice/calc or M$/excel.
I have found this task in TODO list, also.

I've begin my work, modify COPY syntax in:

COPY tablename [ ( column [, ...] ) ]   FROM { 'filename' | STDIN }   [ [ WITH ]         [ BINARY ]         [ OIDS ]
    [ DELIMITER [ AS ] 'delimiter' ]         [ [ OPTIONALLY ] ENCLOSED [ BY ] 'delimiter1' [ AND
 
'delimiter2' ] ]         [ NULL [ AS ] 'null string' ] ]

COPY tablename [ ( column [, ...] ) ]   TO { 'filename' | STDOUT }   [ [ WITH ]         [ BINARY ]         [ OIDS ]
   [ DELIMITER [ AS ] 'delimiter' ]         [ ENCLOSED [ BY ] 'delimiter1' [ AND 'delimiter2' ] ]         [ NULL [ AS ]
'nullstring' ] ]
 

Syntax is like to  control-file of Oracle's utility sql*load.
Enclosed define the first and second  delimiters (if are different)
which surround each field.
The delimiters may be optionally if keyword exists.

At soon!
Umberto Zappi.




pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: PostgreSQL pre-fork speedup
Next
From: prem@mazunetworks.com (Prem Gopalan)
Date:
Subject: Postgres Crashes