Skip to content

Commit ba7614e

Browse files
committed
Additional checks to pass regression tests
1 parent 0eaeac8 commit ba7614e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

contrib/tempscan/nodeCustomTempScan.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,13 @@ try_partial_tempscan(PlannerInfo *root, RelOptInfo *rel, Index rti,
412412
if (set_rel_pathlist_hook_next)
413413
(*set_rel_pathlist_hook_next)(root, rel, rti, rte);
414414

415-
if (!tempscan_enable || rel->consider_parallel)
415+
if (!tempscan_enable || rel->consider_parallel || rte->inh)
416416
return;
417417

418-
if (rte->rtekind != RTE_RELATION || rel->reloptkind != RELOPT_BASEREL ||
419-
get_rel_persistence(rte->relid) != RELPERSISTENCE_TEMP)
418+
if (rte->rtekind != RTE_RELATION || rte->relkind != RELKIND_RELATION ||
419+
rel->reloptkind != RELOPT_BASEREL ||
420+
get_rel_persistence(rte->relid) != RELPERSISTENCE_TEMP ||
421+
root->query_level > 1)
420422
return;
421423

422424
if (!is_parallel_safe(root, (Node *) rel->baserestrictinfo) ||

0 commit comments

Comments
 (0)