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 1uNDxu-00EaMX-C8 for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jun 2025 17:01: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 1uNDxs-00BxYu-9D for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jun 2025 17:01:16 +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 1uNDxr-00BxYl-UV for pgsql-hackers@lists.postgresql.org; Thu, 05 Jun 2025 17:01:16 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uNDxp-000OWk-0A for pgsql-hackers@lists.postgresql.org; Thu, 05 Jun 2025 17:01:16 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 404DE138034D; Thu, 5 Jun 2025 13:01:10 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Thu, 05 Jun 2025 13:01:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1749142870; x=1749229270; bh=C VT6a2VInCZFsldRs818OoKaanhBHRiEu+S32MAbrwc=; b=PXAC6UtpQcCCDX13U wEwiQfQ2YBn7Jb85Bfk0onK1tJdFpg3wH8H6Ev24tEoegIpkucXdLERJjcxGj83r SnNris2GY63cOOjvuBDJ8RKPFBR+rDKjar5TuNbd8s8geBqNBeElBwXsSiTfNcl0 3PbPbY92kTOGbu9WqwHCp43fmaYlF/LavguUdqcbj3Eu8T6M/B4hWX6+CiIMxhOa rFuW/hgiTYwnXAAkkm11lZiy2TRF/qF7GRBD5YeQqDa+ulVDhrA37uCZRdoOYokU o77KpKt4NdbZIzGDRJyOig/MRX2InL9OEb4Dj/UPWfkynVvOenExqsPvJJGqabID GveNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdefleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeen ucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffh jeejhffgieeuueekjeekfffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprh gtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrhhestgihsggv rhhtvggtrdgrthdprhgtphhtthhopehjihgrnhdruhhnihhvvghrshgrlhhithihsehgmh grihhlrdgtohhmpdhrtghpthhtohepshhulhgrmhhulhesghhmrghilhdrtghomhdprhgt phhtthhopehtnhgurhifrghnghesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqh hlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Jun 2025 13:01:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1749142866; bh=nwrVPzO2fD21AahlDvT/MCdlzWrj97R7Dk+2Sjs6kAc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=N2Fkh1zSxs/dV0fCYkYRvKkZajFYhnPK1DYcVBEMqqcTTQjufew3sP9EL/BGwZxKI meX8m7teQMZQ9qcLJ4YLcYuIWzmbuw56QExZR5uTUTrZWxd7OBpHZjY3p2mKivSs0A DY0XMScw86p1Uv0itXUUTYallumaj/9X6aTlKwBvy7vnJmaCcTgmel84mbJzwIwE+1 bwmho9jxKEMdoCnDLRhGlGTTBFPbJ6v/7q06Z2W7ClrUt8Wi8sqRqTitiQlKYHcAhT E5d7Wbtds3oAsx9iwoZtoyCvpfdEMTFmhEVx3hL3d0q+Z2mAo4YRt4mnqFul9Kxo/x eroHlpOwetGWw== Received: by schmee.kurilemu.local (Postfix, from userid 1000) id D347C90; Thu, 5 Jun 2025 13:01:06 -0400 (EDT) Date: Thu, 5 Jun 2025 19:01:06 +0200 From: Alvaro Herrera To: jian he Cc: Amul Sul , Tender Wang , pgsql-hackers@lists.postgresql.org, Antonin Houska Subject: Re: Foreign key validation failure in 18beta1 Message-ID: <202506051701.wjgu2jhnksb5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Jun-04, jian he wrote: > On Tue, Jun 3, 2025 at 12:14 PM Amul Sul wrote: > > > I found a third approach that requires only a few changes. The key > > idea is to determine the root referenced table and pass it to > > QueueFKConstraintValidation(). We would then enqueue phase 3 > > validation only if the constraint tuple’s confrelid matches that root > > table -- similar to what is doing in ATExecAlterConstrEnforceability(). > > > > This would also ensure that the logic for adding/skipping phase 3 > > validation is consistent in both places. > > indeed! > > v7 is way more intuitive compared with v5, v6. Agreed, this version is better than the previous ones. I split it as two commits, for NOT VALID and NOT ENFORCED separately, and modified some comments a bit as well as the commit messages. Thank you! -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Cuando mañana llegue pelearemos segun lo que mañana exija" (Mowgli)