Skip to content

Commit 073b68e

Browse files
committed
Adjust ExecInitRangeTable call to PG18 changes
PG18 adds unpruned relids bitmapset to ExecInitRangeTable postgres/postgres@cbc12791 Track unpruned relids to avoid processing pruned relations
1 parent 62a634a commit 073b68e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/copy.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,9 +892,17 @@ copyfrom(CopyChunkState *ccstate, ParseState *pstate, Hypertable *ht, MemoryCont
892892

893893
#if PG16_LT
894894
ExecInitRangeTable(estate, pstate->p_rtable);
895-
#else
895+
#elif PG18_LT
896896
Assert(pstate->p_rteperminfos != NULL);
897897
ExecInitRangeTable(estate, pstate->p_rtable, pstate->p_rteperminfos);
898+
#else
899+
/*
900+
* PG18+ adds unpruned relids to ExecInitRangeTable
901+
* We initialize it with 1 similar to upstream behavior,
902+
* but since this is copy no pruning is expected to happen.
903+
*/
904+
Assert(pstate->p_rteperminfos != NULL);
905+
ExecInitRangeTable(estate, pstate->p_rtable, pstate->p_rteperminfos, bms_make_singleton(1));
898906
#endif
899907
ExecInitResultRelation(estate, resultRelInfo, 1);
900908

0 commit comments

Comments
 (0)