Re: Ragged CSV import - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Ragged CSV import
Date
Msg-id 14071.1252551669@sss.pgh.pa.us
Whole thread Raw
In response to Re: Ragged CSV import  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Ragged CSV import
Re: Ragged CSV import
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Robert Haas wrote:
>> I wonder whether it would be appropriate to do something like
>> implement a method by which copy could return text[] and then one
>> could write wrappers around that functionality to do this as well as
>> other things.  

> Anything along these lines in C is likely to be far larger than what I 
> had in mind, which was a fairly minor enhancement.

I think Robert's got a point though.  What you're talking about is a
fairly specialized single-purpose feature, which nonetheless is going to
require a lot of infrastructure (for example, teaching psql's \copy
about it).  Perhaps, for approximately the same amount of overhead,
we could provide something more general.

I don't agree with the idea of injecting something "behind" copy though.
The thought that comes to mind for me is something "in front of" copy,
that is, give it the text of each line and let it do a text-to-text
transformation before COPY chews on it.

Any of this is getting into territory we had previously agreed not to
let COPY venture into, ie general purpose data transformation.  I'm not
sure I want to cross that bridge and only get "ignore extra columns" out
of it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Ragged CSV import
Next
From: Andrew Dunstan
Date:
Subject: Re: Ragged CSV import