Re: multiline CSV fields - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: multiline CSV fields
Date
Msg-id 41942903.4080208@dunslane.net
Whole thread Raw
In response to Re: multiline CSV fields  (Patrick B Kelly <pbk@patrickbkelly.org>)
Responses Re: multiline CSV fields  (Patrick B Kelly <pbk@patrickbkelly.org>)
List pgsql-hackers

Patrick B Kelly wrote:

>
>
>
> My suggestion is to simply have CopyReadLine recognize these two 
> states (in-field and out-of-field) and execute the current logic only 
> while in the second state. It would not be too hard but as you 
> mentioned it is non-trivial.
>
>
>

We don't know what state we expect the end of line to be in until after 
we have actually read the line. To know how to treat the end of line on 
your scheme we would have to parse as we go rather than after reading 
the line as now. Changing this would be not only be non-trivial but 
significantly invasive to the code.

cheers

andrew


pgsql-hackers by date:

Previous
From: Patrick B Kelly
Date:
Subject: Re: multiline CSV fields
Next
From: Patrick B Kelly
Date:
Subject: Re: multiline CSV fields