Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3LU5-00069P-Pm for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Aug 2019 14:33:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i3LU3-0003AC-NA for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Aug 2019 14:33:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3LU3-0002yv-B4 for pgsql-bugs@lists.postgresql.org; Thu, 29 Aug 2019 14:33:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i3LU1-0005Dy-74 for pgsql-bugs@lists.postgresql.org; Thu, 29 Aug 2019 14:33:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7TEX3oI020555; Thu, 29 Aug 2019 10:33:03 -0400 From: Tom Lane To: james.inform@pharmapp.de cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15983: pg_dump converts CRLF to LF In-reply-to: <15983-04588b1c04500093@postgresql.org> References: <15983-04588b1c04500093@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 29 Aug 2019 14:07:36 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20553.1567089183.1@sss.pgh.pa.us> Date: Thu, 29 Aug 2019 10:33:03 -0400 Message-ID: <20554.1567089183@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > When using "pg_dump --inserts" to generate insert statements in my dump > file, all line feeds (LF and CRLF) in e.g. text fields are converted to > LF. Can't reproduce that here: the dump is correctly re-imported when I read it in psql, either with \i or with "-f". In the --inserts form, the newlines are just going to appear verbatim in the dump file, so they are very vulnerable to *other* tools deciding to convert them, and I speculate that that's what happened to your file. We could protect against that perhaps by dumping such strings using E'...\r\n...', but that would be entirely unportable to other DBMSes. Since the only real use-case for --inserts mode (IMO anyway) is to transfer data to other DBMSes, that doesn't seem like a win. regards, tom lane