From 5f2caf48ef76b2e81b1ff13fbfa8216d6f5a9e7e Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Fri, 8 May 2026 14:33:52 +0200 Subject: [PATCH] Use PG_MODULE_MAGIC_EXT in PostgreSQL 18 and later The PG_MODULE_MAGIC_EXT macro was added in PostgreSQL 18 and makes it possible to see which version of the library is actually loaded using pg_get_loaded_modules(). --- src/pljs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pljs.c b/src/pljs.c index 35ecdfe..6d6d85e 100644 --- a/src/pljs.c +++ b/src/pljs.c @@ -20,7 +20,11 @@ #include "pljs.h" +#if PG_VERSION_NUM >= 180000 +PG_MODULE_MAGIC_EXT(.name = "pljs", .version = PLJS_VERSION); +#else PG_MODULE_MAGIC; +#endif PG_FUNCTION_INFO_V1(pljs_call_handler); PG_FUNCTION_INFO_V1(pljs_call_validator);