pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: hackerzheng666@gmail.com
Cc: pgsql-bugs@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>
Subject: Re: BUG #19924: unrecognized node type in create_plan_recurse: UNION, LIMIT, json_populate_recordset, inheritance
Date: Fri, 20 Nov 2026 16:20:26 -0500
Message-ID: <1714675.1795209626@sss.pgh.pa.us> (raw)
In-Reply-To: <1713251.1795207985@sss.pgh.pa.us>
References: <19924-8aecd924385fafcc@postgresql.org>
	<1713251.1795207985@sss.pgh.pa.us>

I wrote:
> Not sure about a productive way to narrow this down :-(

I made a little further progress with gdb, and determined that
the missing path is (unsurprisingly at this point) a partial
path, for which we still have a Gather path, and that path
is getting chosen.  This makes the failure go away:

inline patch 1: src/backend/optimizer/util/pathnode.c (+0/-1 lines) download inline-1.patchdiff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 3af494f269d..49803a325d6 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -863,7 +863,6 @@ add_partial_path(RelOptInfo *parent_rel, Path *new_path) { parent_rel->partial_pathlist = foreach_delete_current(parent_rel->partial_pathlist, p1); - pfree(old_path); } else {
but of course that's likely to be an unacceptably memory-hungry solution. What I think must be happening here is that we are building Gather paths before we have finished letting the add_partial_path tournament run. This is a Bad Thing just from the point of view of wasted cycles, never mind dangling pointers. We should wait till all the partial paths are made for a rel, and only then build Gather paths atop the surviving partial paths. regards, tom lane

view thread (6+ messages)  latest in thread

Message-ID: <1714675.1795209626@sss.pgh.pa.us>
Permalink:  ../1714675.1795209626@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1714675.1795209626@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, hackerzheng666@gmail.com, robertmhaas@gmail.com
  Subject: Re: BUG #19924: unrecognized node type in create_plan_recurse: UNION, LIMIT, json_populate_recordset, inheritance
  In-Reply-To: <1714675.1795209626@sss.pgh.pa.us>
  References: <19924-8aecd924385fafcc@postgresql.org> <1713251.1795207985@sss.pgh.pa.us> <1714675.1795209626@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