Re: [BUG] Remove self joins causes 'variable not found in subplan target lists' error
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Sergey Soloviev <sergey.soloviev@tantorlabs.ru>,
Alexander Korotkov <aekorotkov@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2025-08-28T00:15:35Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix semijoin unique-ification for child relations
- 58ea074f1433 18.0 landed
- 97b0f36bde9a 19 (unreleased) landed
-
Fix "variable not found in subplan target lists" in semijoin de-duplication.
- b8a1bdc458e3 19 (unreleased) landed
- 3aee6283709f 18.0 landed
-
Recalculate where-needed data accurately after a join removal.
- a3179ab692be 18.0 cited
I wrote: > This leaves us with some pretty unappetizing choices about what > to do in v18: > 1. Try to emulate the proposed HEAD fix. Actually, a preliminary look suggests that we can approximate that quite well, because v18's create_unique_path() is already responsible for preparing the list of columns to be de-duplicated by a UniquePath. So we can stick the same logic about whether make_pathkeys_for_sortclauses believes that each column adds something into create_unique_path(). Unlike the case with HEAD, that doesn't overlap with any useful work the function was already doing, but I still think that the cost will be negligible in normal cases. I'll try to have a patch along those lines by tomorrow. regards, tom lane