Re: multiline CSV fields - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: multiline CSV fields
Date
Msg-id 41AFB2D7.9020000@dunslane.net
Whole thread Raw
In response to Re: multiline CSV fields  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> writes:
>
>
>>+         if (!embedded_line_warning  && (c == '\n' || c == '\r') )
>>+         {
>>+             embedded_line_warning = true;
>>+             elog(WARNING,
>>+                  "CSV fields with embedded linefeed or carriage return "
>>+                  "characters might not be able to be reimported");
>>+         }
>>
>>
>
>What about forcibly translating them to the two-character sequences \n
>or \r?  Or is that not considered a CSV-compatible representation?
>
>
>
>

Not compatible AFAIK. Certainly not portably. And the warning would
still be true, because we don't do this unescaping on the way back in. I
think the way the comment in the patch suggests and previous emails have
discussed is the right way to go with this - I will attend to it after
we branch ;-)

cheers

andrew

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: 8.0RC1 tomorrow
Next
From: Peter Eisentraut
Date:
Subject: Re: 8.0RC1 tomorrow