diff options
Diffstat (limited to 'src/backend/optimizer/path/tidpath.c')
-rw-r--r-- | src/backend/optimizer/path/tidpath.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/optimizer/path/tidpath.c b/src/backend/optimizer/path/tidpath.c index 35702c27050..36390d50a2e 100644 --- a/src/backend/optimizer/path/tidpath.c +++ b/src/backend/optimizer/path/tidpath.c @@ -249,10 +249,20 @@ TidQualFromRestrictinfo(List *restrictinfo, int varno) void create_tidscan_paths(PlannerInfo *root, RelOptInfo *rel) { + Relids required_outer; List *tidquals; + /* + * We don't support pushing join clauses into the quals of a tidscan, but + * it could still have required parameterization due to LATERAL refs in + * its tlist. (That can only happen if the tidscan is on a relation + * pulled up out of a UNION ALL appendrel.) + */ + required_outer = rel->lateral_relids; + tidquals = TidQualFromRestrictinfo(rel->baserestrictinfo, rel->relid); if (tidquals) - add_path(rel, (Path *) create_tidscan_path(root, rel, tidquals)); + add_path(rel, (Path *) create_tidscan_path(root, rel, tidquals, + required_outer)); } |