summaryrefslogtreecommitdiff
path: root/contrib/auto_explain/auto_explain.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-03-26 10:59:42 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2025-03-26 11:06:12 -0400
commit9324c8c580655800331b0582b770e88c01b7a5c4 (patch)
tree7abf1f4eebd29cb26fa05fc984db644fb174328d /contrib/auto_explain/auto_explain.c
parente92c0632c1473fe57383c58f0dfdde3bae7044f4 (diff)
Introduce PG_MODULE_MAGIC_EXT macro.
This macro allows dynamically loaded shared libraries (modules) to provide a wired-in module name and version, and possibly other compile-time-constant fields in future. This information can be retrieved with the new pg_get_loaded_modules() function. This feature is expected to be particularly useful for modules that do not have any exposed SQL functionality and thus are not associated with a SQL-level extension object. But even for modules that do belong to extensions, being able to verify the actual code version can be useful. Author: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Yurii Rashkovskii <yrashk@omnigres.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/dd4d1b59-d0fe-49d5-b28f-1e463b68fa32@gmail.com
Diffstat (limited to 'contrib/auto_explain/auto_explain.c')
-rw-r--r--contrib/auto_explain/auto_explain.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/auto_explain/auto_explain.c b/contrib/auto_explain/auto_explain.c
index 3b73bd19107..cd6625020a7 100644
--- a/contrib/auto_explain/auto_explain.c
+++ b/contrib/auto_explain/auto_explain.c
@@ -22,7 +22,10 @@
#include "executor/instrument.h"
#include "utils/guc.h"
-PG_MODULE_MAGIC;
+PG_MODULE_MAGIC_EXT(
+ .name = "auto_explain",
+ .version = PG_VERSION
+);
/* GUC variables */
static int auto_explain_log_min_duration = -1; /* msec or -1 */