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 1tZtfo-00E6v3-QJ for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jan 2025 15:26:45 +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 1tZtfn-003GfU-6a for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jan 2025 15:26:43 +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 1tZtfm-003GfG-G5 for pgsql-hackers@lists.postgresql.org; Mon, 20 Jan 2025 15:26:42 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tZtfk-000ZTm-0n for pgsql-hackers@postgresql.org; Mon, 20 Jan 2025 15:26:41 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 45158114015F; Mon, 20 Jan 2025 10:26:39 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Mon, 20 Jan 2025 10:26:39 -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=fm2; t=1737386799; x=1737473199; bh=T carRxEX+AMYbs3xBKuV7TCF1luIkzx1XeqhoYVdzKY=; b=FMPG9vsY5ZO7Au7Qd qAEz+Yxqmff1f94IZL4nTDr+5yuClkBLqKeiziGykMTJPJ8SIWHPsahpluPXtJqC c8r2QVVQVHmqGamvhY/ZOamsnWIo05X12LSCjHo3IdshK8jsGTwSPrJwpQgdkllm MyUywKzqrm63iKWWsS9kph+clqmPDQXiuPN9NBL4UK91YDrx9xrMA6p/nlCub1rA 4RqXpOYzJ9zqnJnbunjoDGPmKwoUGSUtGY0ntg+oGOfTRY9/SHzBehifmJlf85g3 5K6suuFiuMwWIN7PI4fRIdd7ytHRd+ej2G5z9F2yBKsKF459IlIBwShyZ1/X8Zkd bSiOA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeiledgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeen ucfhrhhomheplmhlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdehueffhefgueekueefheeh gffhuefgfedukeejveduffegffekgeffffevgeehnecuffhomhgrihhnpegvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprh gtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehsrghmihhmshgv ihhhsehgmhgrihhlrdgtohhmpdhrtghpthhtohepshhulhgrmhhulhesghhmrghilhdrtg homhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdr ohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Jan 2025 10:26:38 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1737386795; bh=g9W/I0OWbWFsk8OJ15eWavhSBogp5JZKox6pzAyw98w=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=TfH9imaOw5f2Jz5ehIEzfLd+yEo9ujhQmtlUkPlavEgOtKUpKEkjebssVdLIJlzQd qSqMsowZJPp1NosJGJkFyW3J2GHeE1+neQmq2xnKK1ITJEvXLQYVKmiqEYJSDQWV2/ xz+JlRn0K+ysHetj1K5cYJyctyvz/Nri65gSZuBqZEfuUHhFJQsO3Iq5fRsI/GiKNO PDpxm13PbctroWE2DavAj2+rvF5RIMFFz5jQRN8TrAr5720bMsqTJhv6k7/QAfrvsJ 6J8BOESY6d4VBpyWSHfTfiFzPMRw7hjjmzFjSsHt2e6SQwcc459HKcXb+fyzz/MwYC TNiSgT43QT9dg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id A9C0BA2; Mon, 20 Jan 2025 16:26:35 +0100 (CET) Date: Mon, 20 Jan 2025 16:26:35 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Sami Imseih Cc: Amul Sul , PostgreSQL-development Subject: Re: Bug in detaching a partition with a foreign key. Message-ID: <202501201526.qvxjk2ptyqop@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-Jan-20, Sami Imseih wrote: > Below is the repro I used. Similar as you original repro, > but without subpartition on foo_p0. This also results in the segfault > with your attached patch. I think the issue in Amul's patch is just that the list was not initialized to NIL. Other than the lack of comments, which I'm in the process of writing, the initial patch Amul submitted seems largely correct to me, in my understanding of the situation. I'll throw in a few tests, hoping that it'll prove correct, and if so then I'll get it pushed soon. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "El hombre nunca sabe de lo que es capaz hasta que lo intenta" (C. Dickens)