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.96) (envelope-from ) id 1wETuM-00442i-08 for pgsql-general@arkaria.postgresql.org; Sun, 19 Apr 2026 15:18:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wETuL-00FZqd-0O for pgsql-general@arkaria.postgresql.org; Sun, 19 Apr 2026 15:18:01 +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.96) (envelope-from ) id 1wETuK-00FZqV-2V; Sun, 19 Apr 2026 15:18:00 +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.98.2) (envelope-from ) id 1wETuI-00000001zTY-2C0A; Sun, 19 Apr 2026 15:18:00 +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 63JFHll74040651; Sun, 19 Apr 2026 11:17:47 -0400 From: Tom Lane To: Karsten Hilbert cc: pgsql-general@lists.postgresql.org, pgsql-general Subject: Re: unique constraint violation on multiple-rows update In-reply-to: References: Comments: In-reply-to Karsten Hilbert message dated "Sun, 19 Apr 2026 16:09:18 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4040649.1776611867.1@sss.pgh.pa.us> Date: Sun, 19 Apr 2026 11:17:47 -0400 Message-ID: <4040650.1776611867@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Karsten Hilbert writes: > Am Sun, Apr 19, 2026 at 06:54:02AM -0700 schrieb David G. Johnston: >> You know about deferred constraints, you should use them here. This is one >> of the key use cases motivating their existence. > Indeed. I was of the mistaken impression that UNIQUE > constraints were not deferrable ... Once upon a time they were not, but we fixed that years ago. regards, tom lane