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 1oNEIf-0003pJ-Ii for pgsql-bugs@arkaria.postgresql.org; Sun, 14 Aug 2022 14:09:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oNEIc-0007WD-Pu for pgsql-bugs@arkaria.postgresql.org; Sun, 14 Aug 2022 14:09:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNEIc-0007W3-HV for pgsql-bugs@lists.postgresql.org; Sun, 14 Aug 2022 14:09:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNEIV-0001VA-Ae for pgsql-bugs@lists.postgresql.org; Sun, 14 Aug 2022 14:09:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 27EE8tUR624694; Sun, 14 Aug 2022 10:08:55 -0400 From: Tom Lane To: Noah Misch cc: Svante Richter , pgsql-bugs@lists.postgresql.org Subject: Re: COPY TO CSV produces data that is incompatible/unsafe for \COPY FROM CSV In-reply-to: <20220814070053.GA92855@rfd.leadboat.com> References: <20220814070053.GA92855@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Sun, 14 Aug 2022 00:00:53 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <624692.1660486135.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 14 Aug 2022 10:08:55 -0400 Message-ID: <624693.1660486135@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Noah Misch writes: > The psql documentation says [\copy ... from stdin] looks for "\.". It s= ays > nothing about doing that for [\copy ... from filename]. I wonder if psq= l > should change the filename case to send the whole file to the server, ig= noring > "\." inside. (That is to say, change to match the psql documentation.) This seems like a sensible solution. The need to use an in-band EOF marker when reading from the command source file is clear, and there's no non-kluge way there. But that doesn't mean we should extend it to separate files. (I'm surprised to realize we do, actually.) regards, tom lane