pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: hackerzheng666@gmail.com, pgsql-bugs@lists.postgresql.org, Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Subject: Re: BUG #19924: unrecognized node type in create_plan_recurse: UNION, LIMIT, json_populate_recordset, inheritance
Date: Fri, 20 Nov 2026 21:24:58 -0500
Message-ID: <1733308.1795227898@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMbWs495pNV3E+hZyjotvUb1iQaU804sg6+2t=XO+y8zbHx9EA@mail.gmail.com>
References: <19924-8aecd924385fafcc@postgresql.org>
	<1713251.1795207985@sss.pgh.pa.us>
	<1714675.1795209626@sss.pgh.pa.us>
	<1722840.1795214860@sss.pgh.pa.us>
	<CAMbWs495pNV3E+hZyjotvUb1iQaU804sg6+2t=XO+y8zbHx9EA@mail.gmail.com>

Richard Guo <guofenglinux@gmail.com> writes:
> On Sat, Nov 21, 2026 at 7:48 AM Tom Lane <tgl@sss.pgh.pa.us> 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






view thread (6+ messages)

Message-ID: <1733308.1795227898@sss.pgh.pa.us>
Permalink:  ../1733308.1795227898@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1733308.1795227898@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, guofenglinux@gmail.com, robertmhaas@gmail.com, jeevan.chalke@enterprisedb.com
  Subject: Re: BUG #19924: unrecognized node type in create_plan_recurse: UNION, LIMIT, json_populate_recordset, inheritance
  In-Reply-To: <1733308.1795227898@sss.pgh.pa.us>
  References: <19924-8aecd924385fafcc@postgresql.org> <1713251.1795207985@sss.pgh.pa.us> <1714675.1795209626@sss.pgh.pa.us> <1722840.1795214860@sss.pgh.pa.us> <CAMbWs495pNV3E+hZyjotvUb1iQaU804sg6+2t=XO+y8zbHx9EA@mail.gmail.com> <1733308.1795227898@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox