pgvector.git / summary / log / commit / refs

commit    3f687687eea0e240fb19e700ec40df3742e99bd1
Author:   Andrew Kane <andrew@ankane.org>
Date:     Thu Sep 04 22:58:23 2025 +0000

    Fixed compilation error with Postgres 19


src/hnsw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hnsw.c b/src/hnsw.c index 6a6db507..1d56ef6e 100644 --- a/src/hnsw.c +++ b/src/hnsw.c @@ -52,12 +52,20 @@ HnswInitLockTranche(void) sizeof(int) * 1, &found); if (!found) + { +#if PG_VERSION_NUM >= 190000 + tranche_ids[0] = LWLockNewTrancheId("HnswBuild"); +#else tranche_ids[0] = LWLockNewTrancheId(); +#endif + } hnsw_lock_tranche_id = tranche_ids[0]; LWLockRelease(AddinShmemInitLock); +#if PG_VERSION_NUM < 190000 /* Per-backend registration of the tranche ID */ LWLockRegisterTranche(hnsw_lock_tranche_id, "HnswBuild"); +#endif } /* [parent: 815f48e4899c]