From 3f687687eea0e240fb19e700ec40df3742e99bd1 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 4 Sep 2025 15:58:23 -0700 Subject: [PATCH] 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 6a6db50..1d56ef6 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 } /*