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 1tp1TG-00HAMK-EU for pgsql-general@arkaria.postgresql.org; Mon, 03 Mar 2025 08:48:18 +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 1tox6Y-00E06E-81 for pgsql-general@arkaria.postgresql.org; Mon, 03 Mar 2025 04:08:34 +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 1tox6X-00E064-TN for pgsql-general@lists.postgresql.org; Mon, 03 Mar 2025 04:08:33 +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.96) (envelope-from ) id 1tox6T-000dOR-2n for pgsql-general@lists.postgresql.org; Mon, 03 Mar 2025 04:08:33 +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 52347RFi3558970; Sun, 2 Mar 2025 23:07:27 -0500 From: Tom Lane To: me nefcanto cc: Greg Sabino Mullane , "David G. Johnston" , pgsql-general@lists.postgresql.org Subject: Re: Please implement a catch-all error handler per row, for COPY In-reply-to: References: <2961422.1740846012@sss.pgh.pa.us> Comments: In-reply-to me nefcanto message dated "Mon, 03 Mar 2025 07:14:52 +0330" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3558968.1740974847.1@sss.pgh.pa.us> Date: Sun, 02 Mar 2025 23:07:27 -0500 Message-ID: <3558969.1740974847@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk me nefcanto writes: > The point is, that there is already an `on_error ignore` clause there. This > means that somewhere there is a try/catch per row. If I'm wrong, please let > me know. You are wrong. See https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=d9f7f5d32 https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=9e2d87011 and a ton of related commits. It's possible that the specific case of unique-index violations could be handled in a similar style. But "catch any error whatever" is simply not going to happen here, because a subtransaction per row is not practical. regards, tom lane