mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-11 15:16:54 +08:00
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:
@@ -145,8 +145,14 @@ SampleRows(IvfflatBuildState * buildstate)
|
|||||||
{
|
{
|
||||||
BlockNumber targblock = BlockSampler_Next(&buildstate->bs);
|
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,
|
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 */
|
/* Normalize if needed */
|
||||||
|
|||||||
Reference in New Issue
Block a user