Re: csv format for psql
Daniel Verite <daniel@manitou-mail.org>
From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>,"Fabien COELHO"
<coelho@cri.ensmp.fr>,"Michael Paquier" <michael@paquier.xyz>,"Pg
Hackers" <pgsql-hackers@postgresql.org>
Date: 2018-11-26T17:47:32Z
Lists: pgsql-hackers
Attachments
- psql-csv-backslash-dot-fix.txt (text/plain)
Tom Lane wrote: > OK, reasonable arguments were made why not to allow multi-character > separators. Should we then match the server and insist on a single-byte > separator? It's a bit inconsistent if psql can be made to emit "csv" > files that COPY can't read, especially when it's otherwise a subset > of what COPY allows. I seem to be the only one advocating to accept an Unicode character here, and I won't insist on it. There's still a minor annoyance to solve if we want to claim full compatibility with COPY CSV: backslash followed by dot must be quoted to avoid being interpreted as an end of data indicator. A proposed fix is attached. print_csv_vertical() is left unchanged because it's not possible currently to end up with \. alone on a line with the expanded display: we'd need to allow first for an empty field separator, I believe. Best regards, -- Daniel Vérité PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite
Commits
-
Add CSV table output mode in psql.
- aa2ba50c2c13 12.0 landed
-
Reorganize format options of psql in alphabetical order
- add9182e5908 12.0 landed
-
Complete TODO item:
- 862b20b38228 8.0.0 cited