Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
Date: 2022-03-11 18:28:22
Message-ID: CAKFQuwarYcnb4CDT3BjjZfEdvPnAFcM+NYU2Yv4L_tBNA43hPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday, March 11, 2022, Dominique Devienne <ddevienne(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2022-03-11 18:37:29 Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
Previous Message Dominique Devienne 2022-03-11 17:56:27 COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines