mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-06 04:30:56 +08:00
Added code for Postgres < 11.8
This commit is contained in:
@@ -888,7 +888,21 @@ BuildIndex(Relation heap, Relation index, IndexInfo *indexInfo,
|
|||||||
FlushPages(buildstate);
|
FlushPages(buildstate);
|
||||||
|
|
||||||
if (RelationNeedsWAL(index))
|
if (RelationNeedsWAL(index))
|
||||||
|
{
|
||||||
|
#if PG_VERSION_NUM >= 110008
|
||||||
log_newpage_range(index, MAIN_FORKNUM, 0, RelationGetNumberOfBlocks(index), true);
|
log_newpage_range(index, MAIN_FORKNUM, 0, RelationGetNumberOfBlocks(index), true);
|
||||||
|
#else
|
||||||
|
for (BlockNumber blkno = 0; blkno < RelationGetNumberOfBlocksInFork(index, forkNum); blkno++)
|
||||||
|
{
|
||||||
|
Buffer buf = ReadBufferExtended(index, forkNum, blkno, RBM_NORMAL, NULL);
|
||||||
|
|
||||||
|
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
|
||||||
|
MarkBufferDirty(buf);
|
||||||
|
log_newpage_buffer(buf, true);
|
||||||
|
UnlockReleaseBuffer(buf);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
FreeBuildState(buildstate);
|
FreeBuildState(buildstate);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user