Re: Should CSV parsing be stricter about mid-field quotes? - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: Should CSV parsing be stricter about mid-field quotes?
Date
Msg-id 31677c7c-097f-490c-9527-80f9a4bbfabb@manitou-mail.org
Whole thread Raw
In response to Re: Should CSV parsing be stricter about mid-field quotes?  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: Should CSV parsing be stricter about mid-field quotes?
List pgsql-hackers
    Joel Jacobson wrote:

> Is there a valid reason why \. is needed for COPY FROM filename?
> It seems to me it would only be necessary for the COPY FROM STDIN case,
> since files have a natural end-of-file and a known file size.

Looking at CopyReadLineText() over at [1], I don't see a reason why
the unquoted \. could not be handled with COPY FROM file.
Even COPY FROM STDIN looks like it could be benefit, so that
\copy from file csv would hopefully not choke or truncate the data.
There's still the case when the CSV data is embedded in a psql script
(psql is unable to know where it ends), but for that, "don't do that"
might be a reasonable answer.


[1]
https://doxygen.postgresql.org/copyfromparse_8c.html#a90201f711221dd82d0c08deedd91e1b3



Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite



pgsql-hackers by date:

Previous
From: reid.thompson@crunchydata.com
Date:
Subject: Re: Add the ability to limit the amount of memory that can be allocated to backends.
Next
From: Nikita Malakhov
Date:
Subject: Re: RFI: Extending the TOAST Pointer