Re: BUG #19435: Error: "No relation entry for relid 2" Triggered by Complex Join with Self-Referencing Tables
Tender Wang <tndrwang@gmail.com>
From: Tender Wang <tndrwang@gmail.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Andrei Lepikhov <lepihov@gmail.com>,
Kirill Reshke <reshkekirill@gmail.com>, Fujii Masao <masao.fujii@gmail.com>, ammmkilo@163.com,
pgsql-bugs@lists.postgresql.org
Date: 2026-04-23T08:26:48Z
Lists: pgsql-bugs
Alexander Korotkov <aekorotkov@gmail.com> 于2026年4月22日周三 23:10写道: > > I have another approach about to deduplication of RestrictInfo's. The > field, which differs in this case, is outer_relids. AFAICS, > outer_relids and incompatible_relids serves as the restriction on what > we can do with RestrictInfo. So, what we can do is to ignore both > outer_relids and incompatible_relids during comparison, but compose a > union of their values for remaining RestrictInfo. That means that > remaining RestrictInfo will ancest all the restrictions, and that > should be safe. > > What do you think? It seems workable and safer than the previous solution. -- Thanks, Tender Wang
Commits
-
Further improve commentary about ChangeVarNodesWalkExpression()
- 6888658516a2 19 (unreleased) landed
- 8c73ab9da9f1 18.4 landed
-
Improve commentary about ChangeVarNodesWalkExpression().
- a0e0b3cc685a 18.4 landed
- 360dd6f7b4c5 19 (unreleased) landed
-
Fix self-join removal to update bare Var references in join clauses
- e8b9d6497469 18.4 landed
- 07b7a964d368 19 (unreleased) landed
-
Implement Self-Join Elimination
- fc069a3a6319 18.0 cited