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.98.2) (envelope-from ) id 1xUamz-000000013W6-3y16 for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Nov 2026 02:25:18 +0000 Received: from localhost ([127.0.0.1]:45034 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xUamx-0000000CpvF-0txI for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Nov 2026 02:25:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:46266) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xUamw-0000000CpuU-3zgZ for pgsql-bugs@lists.postgresql.org; Sat, 21 Nov 2026 02:25:14 +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 1xUamp-00000000qCR-3AAi for pgsql-bugs@lists.postgresql.org; Sat, 21 Nov 2026 02:25:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 6AL2Ow9b1733309; Fri, 20 Nov 2026 21:24:58 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6AL2Ow9b1733309 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1795227898; bh=eE1yJSvdtP964xRnJSA9J8TED8KmMmpoU1BKV1lI++Q=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=W2Eeu5uH0Z21mU51ndH02QqV7MqphQVkbMiivugZs5N/bPLg42MwjJsCAJ3S7DyEu wzchIpDdkqpIGrL6Z648nmBqXITkqwcoBXNZUx5uFltLa1OYj8QTEiQZCrhv7iepyO yKZi70jqn84HS8nPuO51KHk52TG6XYXD6nnhYBiY= From: Tom Lane To: Richard Guo cc: Robert Haas , hackerzheng666@gmail.com, pgsql-bugs@lists.postgresql.org, Jeevan Chalke Subject: Re: BUG #19924: unrecognized node type in create_plan_recurse: UNION, LIMIT, json_populate_recordset, inheritance In-reply-to: References: <19924-8aecd924385fafcc@postgresql.org> <1713251.1795207985@sss.pgh.pa.us> <1714675.1795209626@sss.pgh.pa.us> <1722840.1795214860@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Sat, 21 Nov 2026 10:15:52 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1733307.1795227898.1@sss.pgh.pa.us> Date: Fri, 20 Nov 2026 21:24:58 -0500 Message-ID: <1733308.1795227898@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > On Sat, Nov 21, 2026 at 7:48 AM Tom Lane wrote: >> Ah, I identified the problem and a possible fix. The root culprit is >> in grouping_planner(): > I haven't had a close look at this bug, but I feel that this is the > same bug as [1], where Jeevan proposed the same parent check. His > reproducer fails on v18 too, so it predates 8300d3ad4. Ah, I'd lost track of that thread, but I think you're entirely right that it's the same bug. The apparent branch-to-branch behavioral variations are not related to the bug mechanism, but to changing choices about which path to prefer. Notably, it seems like the reason 8300d3ad4 made this example fail is precisely that it allowed startup cost to be considered for partial paths, and thus changed which partial paths survive the add_partial_path tournament ... but not which Gather paths survive the add_path tournament. I concur with the comments on the other thread that reference-counting Paths, while it's the right thing in principle, is far too invasive to be attractive (much less back-patchable). This parent-pointer check idea is surely a hack by comparison, but if it solves all known cases, let's do it. I'm unsure that a regression test for this will actually be very useful; all the known examples seem pretty narrow/brittle and hence unlikely to be meaningful for more than a version or two. regards, tom lane