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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fixing backslash dot for COPY FROM...CSV
Date: 2024-04-07 02:55:04
Message-ID: ZhILCDJpq89Ro3dk@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 7, 2024 at 12:00:25AM +0200, Daniel Verite wrote:
> Tom Lane wrote:
>
> > This is sufficiently weird that I'm starting to come around to
> > Daniel's original proposal that we just drop the server's recognition
> > of \. altogether (which would allow removal of some dozens of lines of
> > complicated and now known-buggy code)
>
> FWIW my plan was to not change anything in the TEXT mode,
> but I wasn't aware it had this issue that you found when
> \. is not in a line by itself.
>
> > Alternatively, we could fix it so that \. at the end of a line draws
> > "end-of-copy marker corrupt"
> > which would at least make things consistent, but I'm not sure that has
> > any great advantage. I surely don't want to document the current
> > behavioral details as being the right thing that we're going to keep
> > doing.
>
> Agreed we don't want to document that, but also why doesn't \. in the
> contents represent just a dot (as opposed to being an error),
> just like \a is a?

I looked into this and started to realize that \. is the only copy
backslash command where we define the behavior only alone at the
beginning of a line, and not in other circumstances. The \a example
above suggests \. should be period in all other cases, as suggested, but
I don't know the ramifications if that.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2024-04-07 03:33:46 Re: Table AM Interface Enhancements
Previous Message John Naylor 2024-04-07 02:08:40 Re: [PoC] Improve dead tuple storage for lazy vacuum