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 bd0f8ba9-2dfa-4fe3-be5d-30b000bca8c4@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:

> I understand its necessity for STDIN, given that the end of input needs to
> be explicitly defined.
> However, for files, we have a known file size and the end-of-file can be
> detected without the need for special markers.
>
> Also, is the difference in how server-side COPY CSV is capable of dealing
> with \. but apparently not the client-side \COPY CSV documented somewhere?

psql implements the client-side "\copy table from file..." with
COPY table FROM STDIN ...

COPY FROM file CSV somewhat differs as your example shows,
but it still mishandle \. when unquoted. For instance, consider this
file to load with COPY    t FROM '/tmp/t.csv' WITH CSV
$ cat /tmp/t.csv
line 1
\.
line 3
line 4

It results in having only "line 1" being imported.


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



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: How to ensure that SSPI support (Windows) enabled?
Next
From: Tom Lane
Date:
Subject: Re: The documentation for READ COMMITTED may be incomplete or wrong