Re: Fixing backslash dot for COPY FROM...CSV

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "vignesh C" <vignesh21(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fixing backslash dot for COPY FROM...CSV
Date: 2023-12-21 19:47:14
Message-ID: 6c6a1ad7-a9ec-4287-ac4d-77ea5d67a9b0@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

vignesh C wrote:

> Thanks for the updated patch, any reason why this is handled only in csv.
> postgres=# copy test1 from '/home/vignesh/postgres/inst/bin/copy1.out';
> COPY 1
> postgres=# select * from test1;
> c1
> -------
> line1
> (1 row)

I believe it's safer to not change anything to the normal "non-csv"
text mode.
The current doc says that \. will not be taken as data in this format.
From https://www.postgresql.org/docs/current/sql-copy.html :

Any other backslashed character that is not mentioned in the above
table will be taken to represent itself. However, beware of adding
backslashes unnecessarily, since that might accidentally produce a
string matching the end-of-data marker (\.) or the null string (\N
by default). These strings will be recognized before any other
backslash processing is done.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-12-21 20:43:00 Re: trying again to get incremental backup
Previous Message Tom Lane 2023-12-21 19:22:02 Re: ci: Build standalone INSTALL file