Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqg8b-0002nT-L7 for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Nov 2022 19:44:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oqg8a-0000v2-IH for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Nov 2022 19:44:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqg8Z-0000tC-Ks for pgsql-hackers@lists.postgresql.org; Thu, 03 Nov 2022 19:44:28 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqg8W-0001bD-Fd for pgsql-hackers@postgresql.org; Thu, 03 Nov 2022 19:44:27 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D8E663200902; Thu, 3 Nov 2022 15:44:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 03 Nov 2022 15:44:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1667504659; x=1667591059; bh=V Dfi7uGRh5YM8kEMwPQH8D+llQCz3DAw9GZrOFjxmjE=; b=T7kLzoY/GWI5ovBPE t0dKKa6/dCbP031/htTR2Wu3mfmWLiQxPIjzrD75alSfMxj97BsLh/EXmuruLSTc tSU4uHHJGM503iK1UIqZGVQgJio8mr76WduQBk1NhFdI9rA+xKjmYBiDwA8PKBG1 6jBj2jAgR2GfAVrb/fy3p7wk/0zIAmD5ondUPS35iRTssPcqN0DdjjPqR5hcXOLp RD+8qwE6cU2Wrn/hF4C6y2XIytZrIjUDLLHHBxytLlM79kfiMLnobdHaBOgwTPfQ kE59E1pVVUzVxVLmyl685r+fzHm2ZTHmWxsLqcGs66jMKAsgN+yyBt2K3XahSMxA 23Ryg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrudelgdduvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Nov 2022 15:44:18 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 91A6474; Thu, 3 Nov 2022 20:44:16 +0100 (CET) Date: Thu, 3 Nov 2022 20:44:16 +0100 From: Alvaro Herrera To: Jehan-Guillaume de Rorthais Cc: Zhihong Yu , pgsql-hackers Subject: Re: [BUG] parenting a PK constraint to a self-FK one (Was: Self FK oddity when attaching a partition) Message-ID: <20221103194416.sdp75teipw4i5hri@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221005105523.bhuhkdx4olajboof@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Oct-05, Alvaro Herrera wrote: > I've been giving the patches a look and it caused me to notice two > additional bugs in the same area: > > - FKs in partitions are sometimes marked NOT VALID. This is because of > missing initialization when faking up a Constraint node in > CloneFkReferencing. Easy to fix, have patch, running tests now. I have pushed the fix for this now. > - The feature added by d6f96ed94e73 (ON DELETE SET NULL (...)) is not > correctly propagated. This should be an easy fix also, haven't tried, > need to add a test case. There was no bug here actually: it's true that the struct member is left uninitialized, but in practice that doesn't matter, because the set of columns is propagated separately from the node. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Las navajas y los monos deben estar siempre distantes" (Germán Poo)