Re: COPY for CSV documentation

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: COPY for CSV documentation
Date: 2004-04-12 11:09:54
Message-ID: 3519.24.211.141.25.1081768194.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian said:
> Andrew Dunstan wrote:
>> Bruce Momjian said:
>> >
>> > COPY tablename [ ( column [, ...] ) ]
>> > TO { 'filename' | STDOUT }
>> > [ [ WITH ]
>> > [ BINARY ]
>> > [ OIDS ]
>> > [ DELIMITER [ AS ] 'delimiter' ]
>> > [ NULL [ AS ] 'null string' ] ]
>> >
>> > [ CSV [ QUOTE 'quote' ] [ ESCAPE 'escape' ] ]
>> >
>> > DELIMITER default to tab, except in CSV mode, where it is a comma.
>> >
>> > That sounds very clear to me.
>> >
>>
>>
>> TIMTOWTDI, as we say in the perl world, and we could debate it
>> endlessly. This looks fine to me.
>>
>> a few points:
>>
>> . ESCAPE should default to same-as-quote
>> . in CSV mode, NULL should default to '' - that was in what I sent in.
>> . I assume that for now we will enforce the one byte rule for QUOTE
>> and ESCAPE as well as for DELIMITER.
>
> Andrew, would you like me to take your patch, implement the changes
> discussed, add \copy, and post the result for your testing?
>

That would be great. Thanks. I don't think the changes to what I did with
copy.c will be huge.

BTW, how to do this is asked at least once a day on the #postgresql
channel on freenode - a lot of people *really* want this.

cheers

andrew

Browse pgsql-patches by date

  From Date Subject
Next Message Bruno Wolff III 2004-04-12 11:42:35 Re: COPY for CSV documentation
Previous Message Bruce Momjian 2004-04-12 08:18:46 Re: COPY for CSV documentation