Fixing backslash dot for COPY FROM...CSV

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Fixing backslash dot for COPY FROM...CSV
Date: 2023-12-18 20:35:53
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


PFA a patch that attempts to fix the bug that \. on a line
by itself is handled incorrectly by COPY FROM ... CSV.
This issue has been discussed several times previously,
for instance in [1] and [2], and mentioned in the
doc for \copy in commit 42d3125.

There's one case that works today: when
the line is part of a multi-line quoted section,
and the data is read from a file, not from the client.
In other situations, an error is raised or the data is cut at
the point of \. without an error.

The patch addresses that issue in the server and in psql,
except for the case of inlined data, where \. cannot be
both valid data and an EOF marker at the same time, so
it keeps treating it as an EOF marker.


Best regards,
Daniel Vérité
Twitter: @DanielVerite

Attachment Content-Type Size
v1-0001-Support-backslash-dot-on-a-line-by-itself-as-vali.patch text/plain 5.9 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2023-12-18 20:39:05 Re: encoding affects ICU regex character classification
Previous Message Jeff Davis 2023-12-18 19:45:46 Re: Built-in CTYPE provider