Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines - Mailing list pgsql-general

From David G. Johnston
Subject Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
Date
Msg-id CAKFQuwarYcnb4CDT3BjjZfEdvPnAFcM+NYU2Yv4L_tBNA43hPA@mail.gmail.com
Whole thread Raw
In response to COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
On Friday, March 11, 2022, Dominique Devienne <ddevienne@gmail.com> wrote:
I've tracked these to text values in the DB with embedded
newlines. These values are 'normal'. I'm not use to CSV, but I suppose
such newlines
must be encoded, perhaps as \n, since AFAIK CSV needs to be 1 line per row, no?

Haven’t tested but the docs indicate, and I do recall from memory, that PostgreSQL does indeed use \r and \n in content so what you are describing would be a bug if proven true.  Can you produce something that only uses psql that shows this problem?  If not, whatever “auto rset = my_exec(…)” is doing is probably at fault.

David J.

pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
Next
From: "Daniel Verite"
Date:
Subject: Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines