pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Verite <daniel@manitou-mail.org>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: david.g.johnston@gmail.com
Cc: pgsql-general@postgresql.org
Subject: Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
Date: Fri, 11 Mar 2022 20:32:02 +0100
Message-ID: <52dc26c2-e3ba-4d12-811a-6bfd04c35bc5@manitou-mail.org> (raw)
In-Reply-To: <CAFCRh-9b9Ast9nqEQXdUSQbs1Q0XvwqWSToFk79kw+9i-UUOCQ@mail.gmail.com>

	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





view thread (8+ messages)  latest in thread

Message-ID: <52dc26c2-e3ba-4d12-811a-6bfd04c35bc5@manitou-mail.org>
Permalink:  ../52dc26c2-e3ba-4d12-811a-6bfd04c35bc5@manitou-mail.org/
Also on:    postgresql.org/message-id/52dc26c2-e3ba-4d12-811a-6bfd04c35bc5@manitou-mail.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: daniel@manitou-mail.org, ddevienne@gmail.com, david.g.johnston@gmail.com
  Subject: Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
  In-Reply-To: <52dc26c2-e3ba-4d12-811a-6bfd04c35bc5@manitou-mail.org>
  References: <CAFCRh-9b9Ast9nqEQXdUSQbs1Q0XvwqWSToFk79kw+9i-UUOCQ@mail.gmail.com> <52dc26c2-e3ba-4d12-811a-6bfd04c35bc5@manitou-mail.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox