Re: Ragged CSV import - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Ragged CSV import
Date
Msg-id 4AAA6CCD.10502@dunslane.net
Whole thread Raw
In response to Re: Ragged CSV import  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Ragged CSV import
List pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>   
>> I wrote:
>>     
>>> I'd love to be able to do something like
>>>
>>> INSERT into foo (x,y,z) select t[3],[t2],[t57] from (COPY RETURNING
>>> t FROM stdin CSV);
>>>       
>
>   
>> Some IRC discussion suggested ways we could do better than that syntax. 
>> I think my current preferred candidate is something like
>>     
>
>   
>>     COPY foo (a,b,c)
>>     FROM stdin
>>     CSV
>>     AS t USING (t[3],t[2],[t57]);
>>     
>
> [ scratches head... ]  What happened to seeing COPY as a data source in
> a larger command?  If that syntax has anything at all to recommend it,
> I'm not seeing what.  It's not extensible and it would require lots of
> code duplication to implement the impoverished feature set it does have.
>
>             
>   

Well, I think the objection was that it would slow COPY down to have to 
go though the executor in the copy-as-source scenario. But maybe that 
would happen anyway, and maybe we don't care, we'd just accept that it 
wouldn't be nearly as fast as a raw copy.

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY enhancements
Next
From: Tom Lane
Date:
Subject: Re: RfD: more powerful "any" types