mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-15 00:56:54 +08:00
Fixed compilation error with Postgres 19
This commit is contained in:
@@ -52,12 +52,20 @@ HnswInitLockTranche(void)
|
|||||||
sizeof(int) * 1,
|
sizeof(int) * 1,
|
||||||
&found);
|
&found);
|
||||||
if (!found)
|
if (!found)
|
||||||
|
{
|
||||||
|
#if PG_VERSION_NUM >= 190000
|
||||||
|
tranche_ids[0] = LWLockNewTrancheId("HnswBuild");
|
||||||
|
#else
|
||||||
tranche_ids[0] = LWLockNewTrancheId();
|
tranche_ids[0] = LWLockNewTrancheId();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
hnsw_lock_tranche_id = tranche_ids[0];
|
hnsw_lock_tranche_id = tranche_ids[0];
|
||||||
LWLockRelease(AddinShmemInitLock);
|
LWLockRelease(AddinShmemInitLock);
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM < 190000
|
||||||
/* Per-backend registration of the tranche ID */
|
/* Per-backend registration of the tranche ID */
|
||||||
LWLockRegisterTranche(hnsw_lock_tranche_id, "HnswBuild");
|
LWLockRegisterTranche(hnsw_lock_tranche_id, "HnswBuild");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user