Re: Fixing backslash dot for COPY FROM...CSV
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sutou Kouhei <kou@clear-code.com>
Cc: bruce@momjian.us, daniel@manitou-mail.org, robertmhaas@gmail.com,
pgsql-hackers@postgresql.org
Date: 2024-07-24T17:36:45Z
Lists: pgsql-hackers
Sutou Kouhei <kou@clear-code.com> writes: > I read through this thread. It seems that this thread > discuss 2 things: > 1. \. in CSV mode > 2. \. in non-CSV mode > Recent messages discussed mainly 2. but how about create a > separated thread for 2.? Because the original mail focused > on 1. and it seems that we can handle them separately. Well, we don't want to paint ourselves into a corner by considering only part of the problem. What I'm currently thinking is that we can't remove the special treatment of \. in text mode. It's not arguably a bug, because it's been part of the specification since day one; and there are too many compatibility risks in pg_dump and elsewhere. I think we should fix it so that \. that's not alone on a line throws an error, but I wouldn't go further than that. > How about introducing a new COPY option that controls > whether "\." is ignored or not instead of this approach? No thanks. Once we create such an option we'll never be able to get rid of it. regards, tom lane
Commits
-
Reject a copy EOF marker that has data ahead of it on the same line.
- da8a4c166647 18.0 landed
-
Do not treat \. as an EOF marker in CSV mode for COPY IN.
- 770233748981 18.0 landed
-
doc: \copy can get data values \. and end-of-input confused
- 42d3125adae1 17.0 cited