Skip to content

Commit d9f2129

Browse files
committed
Allow people to see version of module when loaded
Use the PG_MODULE_MAGIC_EXT to add metadata to the module. When the OAuth validator is loaded people can see which version of the library was used the pg_get_loaded_modules() function.
1 parent 57b268c commit d9f2129

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pg_oidc_validator.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#include "http_client.hpp"
88
#include "jwk.hpp"
99

10+
static const char* ModuleName = "pg_oidc_validator";
11+
static const char* ModuleVersion = "1.0.0";
12+
1013
extern "C" {
1114
#include "postgres.h"
1215
//
@@ -16,7 +19,7 @@ extern "C" {
1619
#include "miscadmin.h"
1720
#include "utils/guc.h"
1821

19-
PG_MODULE_MAGIC;
22+
PG_MODULE_MAGIC_EXT(.name = ModuleName, .version = ModuleVersion);
2023
}
2124

2225
void validator_shutdown(ValidatorModuleState*);

0 commit comments

Comments
 (0)