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 1taLS0-0012UY-Py for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2025 21:06:21 +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 1taLRz-005ivo-Rl for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2025 21:06:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1taLRz-005iuJ-G1 for pgsql-hackers@lists.postgresql.org; Tue, 21 Jan 2025 21:06:19 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1taLRx-000nDA-0b for pgsql-hackers@lists.postgresql.org; Tue, 21 Jan 2025 21:06:18 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id F081213802CA; Tue, 21 Jan 2025 16:06:16 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 21 Jan 2025 16:06:16 -0500 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=fm3; t=1737493576; x=1737579976; bh=5 evwTG5fiOvFd0RbR0WOpUjXGvMhYVog1Fc9KM0saa4=; b=aabmPwiSf/OkLoyD4 RYQi9a1KXFmVS5bkf+eIVrZGID92glkIuoV00nCFVC5HpwcPvl4mUq1RNt8VHqiz z+94w29PoP3OV+RKZhkNY6Aloh+XCAWRNPAq3uKdo8UveQRyik26a9CdtwtOgGR9 Gm5IEQLyDfAFOPg77e666DlqGM2HOVGWafbjOP7r0tlZxlGf0oP5t5IpXsnedk4E +K+GUYQk6RYExF7ip0m4LrJun1VWNJxbYwBLL522yx6mO2ZlBIseGO1p1zTvAfAr FE5O+nyjDyoEDx3DxVvxPlrhcz5wFtItN2OI8b+/x0OjoKoBYjK8uDkaESf25Gwk 1rlrQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejvddgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdej necuhfhrohhmpemllhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeehjeetgeejgfefleefkeej vddthfeiueeiffejvdejkeetfeeltdeuffejtdeiieenucffohhmrghinhepvghnthgvrh hprhhishgvuggsrdgtohhmpdhpohhsthhgrhdrvghsnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqd hiphdrohhrghdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghp thhtohepshhulhgrmhhulhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqd hhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 Jan 2025 16:06:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1737493574; bh=jIEZV9nTj6El65ns+mTRlyCDoEjWHw7FM9T072OGAtw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=RVsi/SZ62+CnMYtvLz6h6Uyg7NI9cflsADXWuUn6PPcbBY4JkuuPJ/QrYchcY/kMU sKgqePaKo+WEyf0YQJuFGl2mWUU2dQ7/yHOO0sVx31qrqh4suTUTFID5GcxBQihuZP h+nt4nKlTrk3wPqifUou7lCqYzVEd3nskQHIlXc9dcgOOemyV+CBTpGVvDnsvJjatG 2EZ8hJQddQ/ShdPSgBXPEiPZfCqmnb1CXMGc0glexPrWjrJv3as96nLeAyCpQPikav mH3MKbOBuyVAVF2kNmUKR9NDURRszSSHk+gJY1TNAQJ9TkBUh9tMUwQDl0ECVGg12X n9OVRunZ2iEMg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id CACB87C; Tue, 21 Jan 2025 22:06:14 +0100 (CET) Date: Tue, 21 Jan 2025 22:06:14 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Amul Sul Cc: "pgsql-hackers@lists.postgresql.org" Subject: Re: Allow NOT VALID foreign key constraints on partitioned tables. Message-ID: <202501212106.2wbouzfk56mb@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 Suppose I have a hierarchy like this parent | child /\ / \ / grandchild2 / grandchild1 and I have a validated constraint on grandchild1 and an invalid constraint on child. What happens if I add a constraint on parent? In my understanding, it should not attempt to revalidate the constraint on grandchild1, because it's known valid; but I don't think I see code that would skip validation there. That is, QueueFKConstraintValidation does its thing unconditionally (esp. recursing to children), which seems wrong. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "I am amazed at [the pgsql-sql] mailing list for the wonderful support, and lack of hesitasion in answering a lost soul's question, I just wished the rest of the mailing list could be like this." (Fotis) https://postgr.es/m/200606261359.k5QDxE2p004593@auth-smtp.hol.gr