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

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Dominique Devienne" <ddevienne(at)gmail(dot)com>
Cc: david(dot)g(dot)johnston(at)gmail(dot)com,pgsql-general(at)postgresql(dot)org
Subject: Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
Date: 2022-03-11 19:32:02
Message-ID: 52dc26c2-e3ba-4d12-811a-6bfd04c35bc5@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dominique Devienne wrote:

> so I can easily do that "\n" encoding myself, as a post-processing on
> the buffer I get back.

Alternatively, it might be easier to use the default TEXT format of
COPY rather than CSV, as the TEXT format already produces \n for
line feeds, along with half a dozen other special backslashes sequences.
See https://www.postgresql.org/docs/current/sql-copy.html

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dominique Devienne 2022-03-11 20:16:17 Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
Previous Message Dominique Devienne 2022-03-11 18:58:18 Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines