Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSl2p-0000tK-Nt for pgsql-general@arkaria.postgresql.org; Fri, 11 Mar 2022 19:35:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nSl2o-0004cU-Hg for pgsql-general@arkaria.postgresql.org; Fri, 11 Mar 2022 19:35:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSkzg-0006IS-Jp for pgsql-general@lists.postgresql.org; Fri, 11 Mar 2022 19:32:08 +0000 Received: from verite.pro ([195.154.133.58] helo=sd-76392.dedibox.fr) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSkze-0006Vm-4p for pgsql-general@postgresql.org; Fri, 11 Mar 2022 19:32:07 +0000 Received: by sd-76392.dedibox.fr (Postfix, from userid 1000) id 96D40224028B; Fri, 11 Mar 2022 20:32:03 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines To: "Dominique Devienne" Cc: david.g.johnston@gmail.com,pgsql-general@postgresql.org In-Reply-To: Date: Fri, 11 Mar 2022 20:32:02 +0100 Message-Id: <52dc26c2-e3ba-4d12-811a-6bfd04c35bc5@manitou-mail.org> X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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, --=20 Daniel V=E9rit=E9 https://postgresql.verite.pro/ Twitter: @DanielVerite