Re: COPY for CSV documentation - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: COPY for CSV documentation
Date
Msg-id 4078ACE3.6070806@dunslane.net
Whole thread Raw
In response to Re: COPY for CSV documentation  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: COPY for CSV documentation
List pgsql-patches

Bruce Momjian wrote:

>>>Prior to 7.2, a multi-character delimiter could be specified, but only
>>>the first character was used.  7.2 release notes state:
>>>
>>>    * COPY DELIMITERS string must be exactly one character (Tom)
>>>
>>>I am a little worried about multibyte too, as you mentioned.
>>>
>>>
>>>
>>I am not sure that CSVs even make sense in a multibyte world. If not, it
>>would make sense to disable it in such a case.
>>
>>(Is that your only worry?)
>>
>>
>
>Yes, my worry is that someone will use a multibyte character that the
>system sees as several bytes and enters CSV mode.
>


How about if we specify it explicitly, like BINARY, instead of it being
implied by the length of DELIMITER?

COPY a FROM stdin CSV DELIMITER ',"';

That would make the patch somewhat more extensive, but maybe not hugely
more invasive (I tried to keep it as uninvasive as possible). I could do
that, I think.

cheers

andrew


pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: New socket code for win32
Next
From: Bruce Momjian
Date:
Subject: Re: COPY for CSV documentation