Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0sT2-008HD4-Sp for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Nov 2023 00:00:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r0sT1-008u1K-9s for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Nov 2023 00:00:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0sT0-008u0x-Vn for pgsql-hackers@lists.postgresql.org; Thu, 09 Nov 2023 00:00:14 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0sSx-005RTc-OW for pgsql-hackers@postgresql.org; Thu, 09 Nov 2023 00:00:14 +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 3A9001A1900124; Wed, 8 Nov 2023 19:00:01 -0500 From: Tom Lane To: Andres Freund cc: Damir , torikoshia , Pgsql Hackers , daniel@yesql.se, anisimow.d@gmail.com, HukuToc@gmail.com, Andrey Lepikhov , Alena Rybakina Subject: Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features) In-reply-to: <20231108235358.jmay4ps767mecrnu@awork3.anarazel.de> References: <43399b33fe573f0548410893f41f84b6@oss.nttdata.com> <8de9d5e1-2f81-ee2e-ece4-b1a6ede1f285@yandex.ru> <58fa3b63e88ffd0a09273e38aec0661e@oss.nttdat! a.com> <739953.1699467519@sss.pgh.pa.us> <20231108235358.jmay4ps767mecrnu@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 08 Nov 2023 15:53:58 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <900122.1699488001.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 08 Nov 2023 19:00:01 -0500 Message-ID: <900123.1699488001@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2023-11-08 13:18:39 -0500, Tom Lane wrote: >> I think an actually usable feature of this sort would involve >> copying all the failed lines to some alternate output medium, >> perhaps a second table with a TEXT column to receive the original >> data line. > If we go in that direction, we should make it possible to *not* use such= a > table as well, for some uses it'd be pointless. Why? You can always just drop the errors table if you don't want it. But I fail to see the use-case for ignoring errors altogether. > Another way of reporting errors could be for copy to return invalid inpu= t back > to the client, via the copy protocol. Color me skeptical. There are approximately zero clients in the world today that could handle simultaneous return of data during a COPY. Certainly neither libpq nor psql are within hailing distance of being able to support that. Maybe in some far future it could be made to work --- but if you want it in the v1 patch, you just moved the goalposts into the next county. regards, tom lane