Merge pull request #979 from xingtanzjr/fix_ivf_create_concurrently

Fix CREATE INDEX CONCURRENTLY crash on ivfflat with assertion-enabled PostgreSQL
This commit is contained in:
Andrew Kane
2026-04-27 03:28:52 -07:00
committed by GitHub

View File

@@ -145,8 +145,14 @@ SampleRows(IvfflatBuildState * buildstate)
{
BlockNumber targblock = BlockSampler_Next(&buildstate->bs);
/*
* anyvisible must be false when the scan uses an MVCC snapshot
* (i.e. CREATE INDEX CONCURRENTLY), otherwise PG will assert in
* heapam_index_build_range_scan. Always pass false here, matching
* what table_index_build_scan does internally.
*/
table_index_build_range_scan(buildstate->heap, buildstate->index, buildstate->indexInfo,
false, true, false, targblock, 1, SampleCallback, (void *) buildstate, NULL);
false, false, false, targblock, 1, SampleCallback, (void *) buildstate, NULL);
}
/* Normalize if needed */