Re: Ragged CSV import - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: Ragged CSV import
Date
Msg-id 4B183FD5.4080009@agliodbs.com
Whole thread Raw
In response to Ragged CSV import  ("Little, Douglas" <DOUGLAS.LITTLE@orbitz.com>)
List pgsql-hackers
Douglas,

> 1. Copy to non-existent table - create it from the data type using most generic datatypes

Yes, that would be nice.  Types chosen would pretty much have to be
TEXT, NUMERIC, and TIMESTAMP for everything though; anything else is too
variable.

> 2. provide column mapping function  - from what I understand that the column list on a copy from is the target
columnsto load.  I assume there must be a header record and the same columns in the 
 

So, like:

COPY table1 ( cola, colb, colc ) FROM 'somecsv.csv' ( 'name', 'place',
'date') WITH CSV HEADER

... which would copy 'name' to cola, 'place' to colb, 'date' to colc,
and ignore any other columns present in the file?

--Josh Berkus


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Adding support for SE-Linux security
Next
From: Tim Bunce
Date:
Subject: First feature patch for plperl - draft [PATCH]