From 4e3ff05e108b765634555707455e85800d66107e Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Thu, 7 May 2026 10:43:38 +0200 Subject: [PATCH] Use PG_MODULE_MAGIC_EXT 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/pg_cron.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pg_cron.c b/src/pg_cron.c index 3cdfc2b..df715ca 100644 --- a/src/pg_cron.c +++ b/src/pg_cron.c @@ -109,8 +109,14 @@ #include "libpq/pqformat.h" #include "utils/builtins.h" - +#if (PG_VERSION_NUM >= 180000) +PG_MODULE_MAGIC_EXT( + .name = "pg_cron", + .version = "1.6.7", +); +#else PG_MODULE_MAGIC; +#endif #ifndef MAXINT8LEN #define MAXINT8LEN 20