1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-18 13:44:19 +03:00

Use PG_MODULE_MAGIC_EXT in our installable shared libraries.

It seems potentially useful to label our shared libraries with version
information, now that a facility exists for retrieving that.  This
patch labels them with the PG_VERSION string.  There was some
discussion about using semantic versioning conventions, but that
doesn't seem terribly helpful for modules with no SQL-level presence;
and for those that do have SQL objects, we typically expect them
to support multiple revisions of the SQL definitions, so it'd still
not be very helpful.

I did not label any of src/test/modules/.  It seems unnecessary since
we don't install those, and besides there ought to be someplace that
still provides test coverage for the original PG_MODULE_MAGIC macro.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/dd4d1b59-d0fe-49d5-b28f-1e463b68fa32@gmail.com
This commit is contained in:
Tom Lane 2025-03-26 11:11:02 -04:00
parent 9324c8c580
commit 55527368bd
89 changed files with 356 additions and 89 deletions

View File

@ -42,7 +42,10 @@
#include "utils/snapmgr.h" #include "utils/snapmgr.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "amcheck",
.version = PG_VERSION
);
/* /*
* A B-Tree cannot possibly have this many levels, since there must be one * A B-Tree cannot possibly have this many levels, since there must be one

View File

@ -16,7 +16,10 @@
#include "libpq/auth.h" #include "libpq/auth.h"
#include "utils/guc.h" #include "utils/guc.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "auth_delay",
.version = PG_VERSION
);
/* GUC Variables */ /* GUC Variables */
static int auth_delay_milliseconds = 0; static int auth_delay_milliseconds = 0;

View File

@ -18,7 +18,10 @@
#include "utils/acl.h" #include "utils/acl.h"
#include "utils/guc.h" #include "utils/guc.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "basebackup_to_shell",
.version = PG_VERSION
);
typedef struct bbsink_shell typedef struct bbsink_shell
{ {

View File

@ -37,7 +37,10 @@
#include "storage/fd.h" #include "storage/fd.h"
#include "utils/guc.h" #include "utils/guc.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "basic_archive",
.version = PG_VERSION
);
static char *archive_directory = NULL; static char *archive_directory = NULL;

View File

@ -22,7 +22,10 @@
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "bloom",
.version = PG_VERSION
);
/* /*
* State of bloom index build. We accumulate one page data here before * State of bloom index build. We accumulate one page data here before

View File

@ -4,7 +4,10 @@
#include "plperl.h" #include "plperl.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "bool_plperl",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(bool_to_plperl); PG_FUNCTION_INFO_V1(bool_to_plperl);

View File

@ -14,7 +14,10 @@
#include "utils/timestamp.h" #include "utils/timestamp.h"
#include "utils/uuid.h" #include "utils/uuid.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "btree_gin",
.version = PG_VERSION
);
typedef struct QueryInfo typedef struct QueryInfo
{ {

View File

@ -7,7 +7,10 @@
#include "access/stratnum.h" #include "access/stratnum.h"
#include "utils/builtins.h" #include "utils/builtins.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "btree_gist",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(gbt_decompress); PG_FUNCTION_INFO_V1(gbt_decompress);
PG_FUNCTION_INFO_V1(gbtreekey_in); PG_FUNCTION_INFO_V1(gbtreekey_in);

View File

@ -10,7 +10,10 @@
#include "utils/varlena.h" #include "utils/varlena.h"
#include "varatt.h" #include "varatt.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "citext",
.version = PG_VERSION
);
/* /*
* ==================== * ====================

View File

@ -17,7 +17,10 @@
#include "utils/array.h" #include "utils/array.h"
#include "utils/float.h" #include "utils/float.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "cube",
.version = PG_VERSION
);
/* /*
* Taken from the intarray contrib header * Taken from the intarray contrib header

View File

@ -65,7 +65,10 @@
#include "utils/varlena.h" #include "utils/varlena.h"
#include "utils/wait_event.h" #include "utils/wait_event.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "dblink",
.version = PG_VERSION
);
typedef struct remoteConn typedef struct remoteConn
{ {

View File

@ -15,7 +15,10 @@
#include "commands/defrem.h" #include "commands/defrem.h"
#include "tsearch/ts_public.h" #include "tsearch/ts_public.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "dict_int",
.version = PG_VERSION
);
typedef struct typedef struct
{ {

View File

@ -20,7 +20,10 @@
#include "tsearch/ts_public.h" #include "tsearch/ts_public.h"
#include "utils/formatting.h" #include "utils/formatting.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "dict_xsyn",
.version = PG_VERSION
);
typedef struct typedef struct
{ {

View File

@ -11,7 +11,10 @@
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "earthdistance",
.version = PG_VERSION
);
/* Earth's radius is in statute miles. */ /* Earth's radius is in statute miles. */
static const double EARTH_RADIUS = 3958.747716; static const double EARTH_RADIUS = 3958.747716;

View File

@ -42,7 +42,10 @@
#include "utils/sampling.h" #include "utils/sampling.h"
#include "utils/varlena.h" #include "utils/varlena.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "file_fdw",
.version = PG_VERSION
);
/* /*
* Describes the valid options for objects that use this wrapper. * Describes the valid options for objects that use this wrapper.

View File

@ -44,7 +44,10 @@
#include "utils/varlena.h" #include "utils/varlena.h"
#include "varatt.h" #include "varatt.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "fuzzystrmatch",
.version = PG_VERSION
);
/* /*
* Soundex * Soundex

View File

@ -21,7 +21,10 @@
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/typcache.h" #include "utils/typcache.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "hstore",
.version = PG_VERSION
);
/* old names for C functions */ /* old names for C functions */
HSTORE_POLLUTE(hstore_from_text, tconvert); HSTORE_POLLUTE(hstore_from_text, tconvert);

View File

@ -4,7 +4,10 @@
#include "hstore/hstore.h" #include "hstore/hstore.h"
#include "plperl.h" #include "plperl.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "hstore_plperl",
.version = PG_VERSION
);
/* Linkage to functions in hstore module */ /* Linkage to functions in hstore module */
typedef HStore *(*hstoreUpgrade_t) (Datum orig); typedef HStore *(*hstoreUpgrade_t) (Datum orig);

View File

@ -5,7 +5,10 @@
#include "plpy_typeio.h" #include "plpy_typeio.h"
#include "plpython.h" #include "plpython.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "hstore_plpython",
.version = PG_VERSION
);
/* Linkage to functions in plpython module */ /* Linkage to functions in plpython module */
typedef char *(*PLyObject_AsString_t) (PyObject *plrv); typedef char *(*PLyObject_AsString_t) (PyObject *plrv);

View File

@ -5,7 +5,10 @@
#include "_int.h" #include "_int.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "intarray",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(_int_different); PG_FUNCTION_INFO_V1(_int_different);
PG_FUNCTION_INFO_V1(_int_same); PG_FUNCTION_INFO_V1(_int_same);

View File

@ -23,7 +23,10 @@
#include "isn.h" #include "isn.h"
#include "utils/guc.h" #include "utils/guc.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "isn",
.version = PG_VERSION
);
#ifdef USE_ASSERT_CHECKING #ifdef USE_ASSERT_CHECKING
#define ISN_DEBUG 1 #define ISN_DEBUG 1

View File

@ -7,7 +7,10 @@
#include "utils/fmgrprotos.h" #include "utils/fmgrprotos.h"
#include "utils/jsonb.h" #include "utils/jsonb.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "jsonb_plperl",
.version = PG_VERSION
);
static SV *Jsonb_to_SV(JsonbContainer *jsonb); static SV *Jsonb_to_SV(JsonbContainer *jsonb);
static JsonbValue *SV_to_JsonbValue(SV *obj, JsonbParseState **ps, bool is_elem); static JsonbValue *SV_to_JsonbValue(SV *obj, JsonbParseState **ps, bool is_elem);

View File

@ -7,7 +7,10 @@
#include "utils/jsonb.h" #include "utils/jsonb.h"
#include "utils/numeric.h" #include "utils/numeric.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "jsonb_plpython",
.version = PG_VERSION
);
/* for PLyObject_AsString in plpy_typeio.c */ /* for PLyObject_AsString in plpy_typeio.c */
typedef char *(*PLyObject_AsString_t) (PyObject *plrv); typedef char *(*PLyObject_AsString_t) (PyObject *plrv);

View File

@ -12,7 +12,10 @@
#include "utils/fmgrprotos.h" #include "utils/fmgrprotos.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "lo",
.version = PG_VERSION
);
/* /*

View File

@ -13,7 +13,10 @@
#include "utils/selfuncs.h" #include "utils/selfuncs.h"
#include "varatt.h" #include "varatt.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "ltree",
.version = PG_VERSION
);
/* compare functions */ /* compare functions */
PG_FUNCTION_INFO_V1(ltree_cmp); PG_FUNCTION_INFO_V1(ltree_cmp);

View File

@ -4,7 +4,10 @@
#include "ltree/ltree.h" #include "ltree/ltree.h"
#include "plpython.h" #include "plpython.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "ltree_plpython",
.version = PG_VERSION
);
/* Linkage to functions in plpython module */ /* Linkage to functions in plpython module */
typedef PyObject *(*PLyUnicode_FromStringAndSize_t) (const char *s, Py_ssize_t size); typedef PyObject *(*PLyUnicode_FromStringAndSize_t) (const char *s, Py_ssize_t size);

View File

@ -29,7 +29,10 @@
#include "utils/rel.h" #include "utils/rel.h"
#include "utils/varlena.h" #include "utils/varlena.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pageinspect",
.version = PG_VERSION
);
static bytea *get_raw_page_internal(text *relname, ForkNumber forknum, static bytea *get_raw_page_internal(text *relname, ForkNumber forknum,
BlockNumber blkno); BlockNumber blkno);

View File

@ -25,7 +25,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "libpq/crypt.h" #include "libpq/crypt.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "passwordcheck",
.version = PG_VERSION
);
/* Saved hook value */ /* Saved hook value */
static check_password_hook_type prev_check_password_hook = NULL; static check_password_hook_type prev_check_password_hook = NULL;

View File

@ -20,7 +20,10 @@
#define NUM_BUFFERCACHE_SUMMARY_ELEM 5 #define NUM_BUFFERCACHE_SUMMARY_ELEM 5
#define NUM_BUFFERCACHE_USAGE_COUNTS_ELEM 4 #define NUM_BUFFERCACHE_USAGE_COUNTS_ELEM 4
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_buffercache",
.version = PG_VERSION
);
/* /*
* Record structure holding the to be exposed cache data. * Record structure holding the to be exposed cache data.

View File

@ -12,7 +12,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "storage/freespace.h" #include "storage/freespace.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_freespacemap",
.version = PG_VERSION
);
/* /*
* Returns the amount of free space on a given page, according to the * Returns the amount of free space on a given page, according to the

View File

@ -18,7 +18,10 @@
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/pg_lsn.h" #include "utils/pg_lsn.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_logicalinspect",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(pg_get_logical_snapshot_meta); PG_FUNCTION_INFO_V1(pg_get_logical_snapshot_meta);
PG_FUNCTION_INFO_V1(pg_get_logical_snapshot_info); PG_FUNCTION_INFO_V1(pg_get_logical_snapshot_info);

View File

@ -26,7 +26,10 @@
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_prewarm",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(pg_prewarm); PG_FUNCTION_INFO_V1(pg_prewarm);

View File

@ -71,7 +71,10 @@
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/timestamp.h" #include "utils/timestamp.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_stat_statements",
.version = PG_VERSION
);
/* Location of permanent stats file (valid when database is shut down) */ /* Location of permanent stats file (valid when database is shut down) */
#define PGSS_DUMP_FILE PGSTAT_STAT_PERMANENT_DIRECTORY "/pg_stat_statements.stat" #define PGSS_DUMP_FILE PGSTAT_STAT_PERMANENT_DIRECTORY "/pg_stat_statements.stat"

View File

@ -23,7 +23,10 @@
#include "utils/array.h" #include "utils/array.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_surgery",
.version = PG_VERSION
);
/* Options to forcefully change the state of a heap tuple. */ /* Options to forcefully change the state of a heap tuple. */
typedef enum HeapTupleForceOption typedef enum HeapTupleForceOption

View File

@ -18,7 +18,10 @@
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/pg_crc.h" #include "utils/pg_crc.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_trgm",
.version = PG_VERSION
);
/* GUC variables */ /* GUC variables */
double similarity_threshold = 0.3f; double similarity_threshold = 0.3f;

View File

@ -25,7 +25,10 @@
#include "storage/smgr.h" #include "storage/smgr.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_visibility",
.version = PG_VERSION
);
typedef struct vbits typedef struct vbits
{ {

View File

@ -29,7 +29,10 @@
* give a thought about doing the same in pg_waldump tool as well. * give a thought about doing the same in pg_waldump tool as well.
*/ */
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pg_walinspect",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(pg_get_wal_block_info); PG_FUNCTION_INFO_V1(pg_get_wal_block_info);
PG_FUNCTION_INFO_V1(pg_get_wal_record_info); PG_FUNCTION_INFO_V1(pg_get_wal_record_info);

View File

@ -41,7 +41,10 @@
#include "utils/guc.h" #include "utils/guc.h"
#include "varatt.h" #include "varatt.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pgcrypto",
.version = PG_VERSION
);
/* private stuff */ /* private stuff */

View File

@ -42,7 +42,10 @@
#include "utils/snapmgr.h" #include "utils/snapmgr.h"
#include "utils/varlena.h" #include "utils/varlena.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pgrowlocks",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(pgrowlocks); PG_FUNCTION_INFO_V1(pgrowlocks);

View File

@ -38,7 +38,10 @@
#include "storage/lmgr.h" #include "storage/lmgr.h"
#include "utils/varlena.h" #include "utils/varlena.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pgstattuple",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(pgstattuple); PG_FUNCTION_INFO_V1(pgstattuple);
PG_FUNCTION_INFO_V1(pgstattuple_v1_5); PG_FUNCTION_INFO_V1(pgstattuple_v1_5);

View File

@ -49,7 +49,10 @@
#include "utils/sampling.h" #include "utils/sampling.h"
#include "utils/selfuncs.h" #include "utils/selfuncs.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "postgres_fdw",
.version = PG_VERSION
);
/* Default CPU cost to start up a foreign query. */ /* Default CPU cost to start up a foreign query. */
#define DEFAULT_FDW_STARTUP_COST 100.0 #define DEFAULT_FDW_STARTUP_COST 100.0

View File

@ -28,7 +28,10 @@
#define GIST_QUERY_DEBUG #define GIST_QUERY_DEBUG
*/ */
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "seg",
.version = PG_VERSION
);
/* /*
* Auxiliary data structure for picksplit method. * Auxiliary data structure for picksplit method.

View File

@ -25,7 +25,10 @@
#include "utils/guc.h" #include "utils/guc.h"
#include "utils/queryenvironment.h" #include "utils/queryenvironment.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "sepgsql",
.version = PG_VERSION
);
/* /*
* Declarations * Declarations

View File

@ -11,7 +11,10 @@
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "autoinc",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(autoinc); PG_FUNCTION_INFO_V1(autoinc);

View File

@ -14,7 +14,10 @@
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "insert_username",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(insert_username); PG_FUNCTION_INFO_V1(insert_username);

View File

@ -22,7 +22,10 @@ OH, me, I'm Terry Mackintosh <terry@terrym.com>
#include "utils/fmgrprotos.h" #include "utils/fmgrprotos.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "moddatetime",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(moddatetime); PG_FUNCTION_INFO_V1(moddatetime);

View File

@ -15,7 +15,10 @@
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "refint",
.version = PG_VERSION
);
typedef struct typedef struct
{ {

View File

@ -19,7 +19,10 @@
#include "miscadmin.h" #include "miscadmin.h"
#include "utils/builtins.h" #include "utils/builtins.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "sslinfo",
.version = PG_VERSION
);
static Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName); static Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName);
static Datum ASN1_STRING_to_text(ASN1_STRING *str); static Datum ASN1_STRING_to_text(ASN1_STRING *str);

View File

@ -44,7 +44,10 @@
#include "miscadmin.h" #include "miscadmin.h"
#include "utils/builtins.h" #include "utils/builtins.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "tablefunc",
.version = PG_VERSION
);
static HTAB *load_categories_hash(char *cats_sql, MemoryContext per_query_ctx); static HTAB *load_categories_hash(char *cats_sql, MemoryContext per_query_ctx);
static Tuplestorestate *get_crosstab_tuplestore(char *sql, static Tuplestorestate *get_crosstab_tuplestore(char *sql,

View File

@ -23,7 +23,10 @@
#include "utils/rel.h" #include "utils/rel.h"
#include "utils/syscache.h" #include "utils/syscache.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "tcn",
.version = PG_VERSION
);
/* /*
* Copy from s (for source) to r (for result), wrapping with q (quote) * Copy from s (for source) to r (for result), wrapping with q (quote)

View File

@ -22,7 +22,10 @@
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/rel.h" #include "utils/rel.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "test_decoding",
.version = PG_VERSION
);
typedef struct typedef struct
{ {

View File

@ -34,7 +34,10 @@
#include "optimizer/optimizer.h" #include "optimizer/optimizer.h"
#include "utils/sampling.h" #include "utils/sampling.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "tsm_system_rows",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(tsm_system_rows_handler); PG_FUNCTION_INFO_V1(tsm_system_rows_handler);

View File

@ -33,7 +33,10 @@
#include "utils/sampling.h" #include "utils/sampling.h"
#include "utils/spccache.h" #include "utils/spccache.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "tsm_system_time",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(tsm_system_time_handler); PG_FUNCTION_INFO_V1(tsm_system_time_handler);

View File

@ -23,7 +23,10 @@
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
#include "utils/syscache.h" #include "utils/syscache.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "unaccent",
.version = PG_VERSION
);
/* /*
* An unaccent dictionary uses a trie to find a string to replace. Each node * An unaccent dictionary uses a trie to find a string to replace. Each node

View File

@ -102,7 +102,10 @@ do { \
#endif /* !HAVE_UUID_OSSP */ #endif /* !HAVE_UUID_OSSP */
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "uuid-ossp",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(uuid_nil); PG_FUNCTION_INFO_V1(uuid_nil);
PG_FUNCTION_INFO_V1(uuid_ns_dns); PG_FUNCTION_INFO_V1(uuid_ns_dns);

View File

@ -22,7 +22,10 @@
#include <libxml/xmlerror.h> #include <libxml/xmlerror.h>
#include <libxml/parserInternals.h> #include <libxml/parserInternals.h>
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "xml2",
.version = PG_VERSION
);
/* exported for use by xslt_proc.c */ /* exported for use by xslt_proc.c */

View File

@ -138,7 +138,10 @@ ResourceOwnerForgetJIT(ResourceOwner owner, LLVMJitContext *handle)
ResourceOwnerForget(owner, PointerGetDatum(handle), &jit_resowner_desc); ResourceOwnerForget(owner, PointerGetDatum(handle), &jit_resowner_desc);
} }
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "llvmjit",
.version = PG_VERSION
);
/* /*

View File

@ -36,7 +36,10 @@
#include "utils/pg_lsn.h" #include "utils/pg_lsn.h"
#include "utils/tuplestore.h" #include "utils/tuplestore.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "libpqwalreceiver",
.version = PG_VERSION
);
struct WalReceiverConn struct WalReceiverConn
{ {

View File

@ -36,7 +36,10 @@
#include "utils/syscache.h" #include "utils/syscache.h"
#include "utils/varlena.h" #include "utils/varlena.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pgoutput",
.version = PG_VERSION
);
static void pgoutput_startup(LogicalDecodingContext *ctx, static void pgoutput_startup(LogicalDecodingContext *ctx,
OutputPluginOptions *opt, bool is_init); OutputPluginOptions *opt, bool is_init);

View File

@ -77,7 +77,10 @@
#include "snowball/libstemmer/stem_UTF_8_turkish.h" #include "snowball/libstemmer/stem_UTF_8_turkish.h"
#include "snowball/libstemmer/stem_UTF_8_yiddish.h" #include "snowball/libstemmer/stem_UTF_8_yiddish.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "dict_snowball",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(dsnowball_init); PG_FUNCTION_INFO_V1(dsnowball_init);

View File

@ -15,7 +15,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "cyrillic_and_mic",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(koi8r_to_mic); PG_FUNCTION_INFO_V1(koi8r_to_mic);
PG_FUNCTION_INFO_V1(mic_to_koi8r); PG_FUNCTION_INFO_V1(mic_to_koi8r);

View File

@ -14,7 +14,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "euc2004_sjis2004",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_jis_2004_to_shift_jis_2004); PG_FUNCTION_INFO_V1(euc_jis_2004_to_shift_jis_2004);
PG_FUNCTION_INFO_V1(shift_jis_2004_to_euc_jis_2004); PG_FUNCTION_INFO_V1(shift_jis_2004_to_euc_jis_2004);

View File

@ -15,7 +15,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "euc_cn_and_mic",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_cn_to_mic); PG_FUNCTION_INFO_V1(euc_cn_to_mic);
PG_FUNCTION_INFO_V1(mic_to_euc_cn); PG_FUNCTION_INFO_V1(mic_to_euc_cn);

View File

@ -27,7 +27,10 @@
*/ */
#include "sjis.map" #include "sjis.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "euc_jp_and_sjis",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_jp_to_sjis); PG_FUNCTION_INFO_V1(euc_jp_to_sjis);
PG_FUNCTION_INFO_V1(sjis_to_euc_jp); PG_FUNCTION_INFO_V1(sjis_to_euc_jp);

View File

@ -15,7 +15,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "euc_kr_and_mic",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_kr_to_mic); PG_FUNCTION_INFO_V1(euc_kr_to_mic);
PG_FUNCTION_INFO_V1(mic_to_euc_kr); PG_FUNCTION_INFO_V1(mic_to_euc_kr);

View File

@ -15,7 +15,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "euc_tw_and_big5",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_tw_to_big5); PG_FUNCTION_INFO_V1(euc_tw_to_big5);
PG_FUNCTION_INFO_V1(big5_to_euc_tw); PG_FUNCTION_INFO_V1(big5_to_euc_tw);

View File

@ -15,7 +15,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "latin2_and_win1250",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(latin2_to_mic); PG_FUNCTION_INFO_V1(latin2_to_mic);
PG_FUNCTION_INFO_V1(mic_to_latin2); PG_FUNCTION_INFO_V1(mic_to_latin2);

View File

@ -15,7 +15,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "latin_and_mic",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(latin1_to_mic); PG_FUNCTION_INFO_V1(latin1_to_mic);
PG_FUNCTION_INFO_V1(mic_to_latin1); PG_FUNCTION_INFO_V1(mic_to_latin1);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/big5_to_utf8.map" #include "../../Unicode/big5_to_utf8.map"
#include "../../Unicode/utf8_to_big5.map" #include "../../Unicode/utf8_to_big5.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_big5",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(big5_to_utf8); PG_FUNCTION_INFO_V1(big5_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_big5); PG_FUNCTION_INFO_V1(utf8_to_big5);

View File

@ -19,7 +19,10 @@
#include "../../Unicode/utf8_to_koi8u.map" #include "../../Unicode/utf8_to_koi8u.map"
#include "../../Unicode/koi8u_to_utf8.map" #include "../../Unicode/koi8u_to_utf8.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_cyrillic",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(utf8_to_koi8r); PG_FUNCTION_INFO_V1(utf8_to_koi8r);
PG_FUNCTION_INFO_V1(koi8r_to_utf8); PG_FUNCTION_INFO_V1(koi8r_to_utf8);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/euc_jis_2004_to_utf8.map" #include "../../Unicode/euc_jis_2004_to_utf8.map"
#include "../../Unicode/utf8_to_euc_jis_2004.map" #include "../../Unicode/utf8_to_euc_jis_2004.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_euc2004",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_jis_2004_to_utf8); PG_FUNCTION_INFO_V1(euc_jis_2004_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_euc_jis_2004); PG_FUNCTION_INFO_V1(utf8_to_euc_jis_2004);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/euc_cn_to_utf8.map" #include "../../Unicode/euc_cn_to_utf8.map"
#include "../../Unicode/utf8_to_euc_cn.map" #include "../../Unicode/utf8_to_euc_cn.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_euc_cn",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_cn_to_utf8); PG_FUNCTION_INFO_V1(euc_cn_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_euc_cn); PG_FUNCTION_INFO_V1(utf8_to_euc_cn);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/euc_jp_to_utf8.map" #include "../../Unicode/euc_jp_to_utf8.map"
#include "../../Unicode/utf8_to_euc_jp.map" #include "../../Unicode/utf8_to_euc_jp.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_euc_jp",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_jp_to_utf8); PG_FUNCTION_INFO_V1(euc_jp_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_euc_jp); PG_FUNCTION_INFO_V1(utf8_to_euc_jp);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/euc_kr_to_utf8.map" #include "../../Unicode/euc_kr_to_utf8.map"
#include "../../Unicode/utf8_to_euc_kr.map" #include "../../Unicode/utf8_to_euc_kr.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_euc_kr",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_kr_to_utf8); PG_FUNCTION_INFO_V1(euc_kr_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_euc_kr); PG_FUNCTION_INFO_V1(utf8_to_euc_kr);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/euc_tw_to_utf8.map" #include "../../Unicode/euc_tw_to_utf8.map"
#include "../../Unicode/utf8_to_euc_tw.map" #include "../../Unicode/utf8_to_euc_tw.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_euc_tw",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(euc_tw_to_utf8); PG_FUNCTION_INFO_V1(euc_tw_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_euc_tw); PG_FUNCTION_INFO_V1(utf8_to_euc_tw);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/gb18030_to_utf8.map" #include "../../Unicode/gb18030_to_utf8.map"
#include "../../Unicode/utf8_to_gb18030.map" #include "../../Unicode/utf8_to_gb18030.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_gb18030",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(gb18030_to_utf8); PG_FUNCTION_INFO_V1(gb18030_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_gb18030); PG_FUNCTION_INFO_V1(utf8_to_gb18030);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/gbk_to_utf8.map" #include "../../Unicode/gbk_to_utf8.map"
#include "../../Unicode/utf8_to_gbk.map" #include "../../Unicode/utf8_to_gbk.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_gbk",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(gbk_to_utf8); PG_FUNCTION_INFO_V1(gbk_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_gbk); PG_FUNCTION_INFO_V1(utf8_to_gbk);

View File

@ -41,7 +41,10 @@
#include "../../Unicode/utf8_to_iso8859_9.map" #include "../../Unicode/utf8_to_iso8859_9.map"
#include "../../Unicode/iso8859_16_to_utf8.map" #include "../../Unicode/iso8859_16_to_utf8.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_iso8859",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(iso8859_to_utf8); PG_FUNCTION_INFO_V1(iso8859_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_iso8859); PG_FUNCTION_INFO_V1(utf8_to_iso8859);

View File

@ -15,7 +15,10 @@
#include "fmgr.h" #include "fmgr.h"
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_iso8859_1",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(iso8859_1_to_utf8); PG_FUNCTION_INFO_V1(iso8859_1_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_iso8859_1); PG_FUNCTION_INFO_V1(utf8_to_iso8859_1);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/johab_to_utf8.map" #include "../../Unicode/johab_to_utf8.map"
#include "../../Unicode/utf8_to_johab.map" #include "../../Unicode/utf8_to_johab.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_johab",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(johab_to_utf8); PG_FUNCTION_INFO_V1(johab_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_johab); PG_FUNCTION_INFO_V1(utf8_to_johab);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/sjis_to_utf8.map" #include "../../Unicode/sjis_to_utf8.map"
#include "../../Unicode/utf8_to_sjis.map" #include "../../Unicode/utf8_to_sjis.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_sjis",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(sjis_to_utf8); PG_FUNCTION_INFO_V1(sjis_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_sjis); PG_FUNCTION_INFO_V1(utf8_to_sjis);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/shift_jis_2004_to_utf8.map" #include "../../Unicode/shift_jis_2004_to_utf8.map"
#include "../../Unicode/utf8_to_shift_jis_2004.map" #include "../../Unicode/utf8_to_shift_jis_2004.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_sjis2004",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(shift_jis_2004_to_utf8); PG_FUNCTION_INFO_V1(shift_jis_2004_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_shift_jis_2004); PG_FUNCTION_INFO_V1(utf8_to_shift_jis_2004);

View File

@ -17,7 +17,10 @@
#include "../../Unicode/uhc_to_utf8.map" #include "../../Unicode/uhc_to_utf8.map"
#include "../../Unicode/utf8_to_uhc.map" #include "../../Unicode/utf8_to_uhc.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_uhc",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(uhc_to_utf8); PG_FUNCTION_INFO_V1(uhc_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_uhc); PG_FUNCTION_INFO_V1(utf8_to_uhc);

View File

@ -37,7 +37,10 @@
#include "../../Unicode/win874_to_utf8.map" #include "../../Unicode/win874_to_utf8.map"
#include "../../Unicode/win1258_to_utf8.map" #include "../../Unicode/win1258_to_utf8.map"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "utf8_and_win",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(win_to_utf8); PG_FUNCTION_INFO_V1(win_to_utf8);
PG_FUNCTION_INFO_V1(utf8_to_win); PG_FUNCTION_INFO_V1(utf8_to_win);

View File

@ -52,7 +52,10 @@ EXTERN_C void boot_DynaLoader(pTHX_ CV *cv);
EXTERN_C void boot_PostgreSQL__InServer__Util(pTHX_ CV *cv); EXTERN_C void boot_PostgreSQL__InServer__Util(pTHX_ CV *cv);
EXTERN_C void boot_PostgreSQL__InServer__SPI(pTHX_ CV *cv); EXTERN_C void boot_PostgreSQL__InServer__SPI(pTHX_ CV *cv);
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "plperl",
.version = PG_VERSION
);
/********************************************************************** /**********************************************************************
* Information associated with a Perl interpreter. We have one interpreter * Information associated with a Perl interpreter. We have one interpreter

View File

@ -31,7 +31,10 @@ static bool plpgsql_extra_checks_check_hook(char **newvalue, void **extra, GucSo
static void plpgsql_extra_warnings_assign_hook(const char *newvalue, void *extra); static void plpgsql_extra_warnings_assign_hook(const char *newvalue, void *extra);
static void plpgsql_extra_errors_assign_hook(const char *newvalue, void *extra); static void plpgsql_extra_errors_assign_hook(const char *newvalue, void *extra);
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "plpgsql",
.version = PG_VERSION
);
/* Custom GUC variable */ /* Custom GUC variable */
static const struct config_enum_entry variable_conflict_options[] = { static const struct config_enum_entry variable_conflict_options[] = {

View File

@ -28,7 +28,10 @@
* exported functions * exported functions
*/ */
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "plpython",
.version = PG_VERSION
);
PG_FUNCTION_INFO_V1(plpython3_validator); PG_FUNCTION_INFO_V1(plpython3_validator);
PG_FUNCTION_INFO_V1(plpython3_call_handler); PG_FUNCTION_INFO_V1(plpython3_call_handler);

View File

@ -39,7 +39,10 @@
#include "utils/typcache.h" #include "utils/typcache.h"
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "pltcl",
.version = PG_VERSION
);
#define HAVE_TCL_VERSION(maj,min) \ #define HAVE_TCL_VERSION(maj,min) \
((TCL_MAJOR_VERSION > maj) || \ ((TCL_MAJOR_VERSION > maj) || \

View File

@ -79,7 +79,10 @@
static void regress_lseg_construct(LSEG *lseg, Point *pt1, Point *pt2); static void regress_lseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
PG_MODULE_MAGIC; PG_MODULE_MAGIC_EXT(
.name = "regress",
.version = PG_VERSION
);
/* return the point where two paths intersect, or NULL if no intersection. */ /* return the point where two paths intersect, or NULL if no intersection. */