BUG #17841: COPY Command Invalid QUOTES

Started by PG Bug reporting formabout 3 years ago2 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 17841
Logged by: Stefan Goldener
Email address: stefan.goldener@theprosperity.company
PostgreSQL version: 11.16
Operating system: x86_64-pc-linux-gnu
Description:

The COPY command doesn't quote properly e.g.:

COPY (SELECT *, CURRENT_DATE as partitiondate FROM {table}) TO STDOUT WITH
(DELIMITER '|', QUOTE '\"', FORCE_QUOTE *, FORMAT CSV, HEADER)

delivers:
faasdfagdf|"1234"||
as output

so the first column is not quoted properly

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: BUG #17841: COPY Command Invalid QUOTES

PG Bug reporting form <noreply@postgresql.org> writes:

The COPY command doesn't quote properly e.g.:

COPY (SELECT *, CURRENT_DATE as partitiondate FROM {table}) TO STDOUT WITH
(DELIMITER '|', QUOTE '\"', FORCE_QUOTE *, FORMAT CSV, HEADER)

delivers:
faasdfagdf|"1234"||
as output

so the first column is not quoted properly

Hm, I failed to duplicate that here, and the relevant code looks
pretty straightforward. Can you give a more concrete example?
Is this server unmodified community Postgres? (The fact that it's
taking QUOTE '\"' without complaint indicates that you're at least
running with some nondefault settings.)

regards, tom lane