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

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fixing backslash dot for COPY FROM...CSV
Date: 2023-12-23 03:32:58
Message-ID: CALDaNm1rss2iR6=Jxk_=S-fWS23Z-70939jdY=QX8Xwpdg9u0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 22 Dec 2023 at 01:17, Daniel Verite <daniel(at)manitou-mail(dot)org> wrote:
>
> 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.

Thanks for the clarification. Then let's keep it as you have implemented.

Regards,
Vignesh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Junwang Zhao 2023-12-23 03:35:17 Re: Transaction timeout
Previous Message vignesh C 2023-12-23 03:22:38 Commitfest manager January 2024