Skip to content

Commit 5552736

Browse files
committed
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
1 parent 9324c8c commit 5552736

File tree

89 files changed

+356
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+356
-89
lines changed

contrib/amcheck/verify_nbtree.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@
4242
#include "utils/snapmgr.h"
4343

4444

45-
PG_MODULE_MAGIC;
45+
PG_MODULE_MAGIC_EXT(
46+
.name = "amcheck",
47+
.version = PG_VERSION
48+
);
4649

4750
/*
4851
* A B-Tree cannot possibly have this many levels, since there must be one

contrib/auth_delay/auth_delay.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
#include "libpq/auth.h"
1717
#include "utils/guc.h"
1818

19-
PG_MODULE_MAGIC;
19+
PG_MODULE_MAGIC_EXT(
20+
.name = "auth_delay",
21+
.version = PG_VERSION
22+
);
2023

2124
/* GUC Variables */
2225
static int auth_delay_milliseconds = 0;

contrib/basebackup_to_shell/basebackup_to_shell.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
#include "utils/acl.h"
1919
#include "utils/guc.h"
2020

21-
PG_MODULE_MAGIC;
21+
PG_MODULE_MAGIC_EXT(
22+
.name = "basebackup_to_shell",
23+
.version = PG_VERSION
24+
);
2225

2326
typedef struct bbsink_shell
2427
{

contrib/basic_archive/basic_archive.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
#include "storage/fd.h"
3838
#include "utils/guc.h"
3939

40-
PG_MODULE_MAGIC;
40+
PG_MODULE_MAGIC_EXT(
41+
.name = "basic_archive",
42+
.version = PG_VERSION
43+
);
4144

4245
static char *archive_directory = NULL;
4346

contrib/bloom/blinsert.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
#include "utils/memutils.h"
2323
#include "utils/rel.h"
2424

25-
PG_MODULE_MAGIC;
25+
PG_MODULE_MAGIC_EXT(
26+
.name = "bloom",
27+
.version = PG_VERSION
28+
);
2629

2730
/*
2831
* State of bloom index build. We accumulate one page data here before

contrib/bool_plperl/bool_plperl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
#include "plperl.h"
55

66

7-
PG_MODULE_MAGIC;
7+
PG_MODULE_MAGIC_EXT(
8+
.name = "bool_plperl",
9+
.version = PG_VERSION
10+
);
811

912
PG_FUNCTION_INFO_V1(bool_to_plperl);
1013

contrib/btree_gin/btree_gin.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
#include "utils/timestamp.h"
1515
#include "utils/uuid.h"
1616

17-
PG_MODULE_MAGIC;
17+
PG_MODULE_MAGIC_EXT(
18+
.name = "btree_gin",
19+
.version = PG_VERSION
20+
);
1821

1922
typedef struct QueryInfo
2023
{

contrib/btree_gist/btree_gist.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
#include "access/stratnum.h"
88
#include "utils/builtins.h"
99

10-
PG_MODULE_MAGIC;
10+
PG_MODULE_MAGIC_EXT(
11+
.name = "btree_gist",
12+
.version = PG_VERSION
13+
);
1114

1215
PG_FUNCTION_INFO_V1(gbt_decompress);
1316
PG_FUNCTION_INFO_V1(gbtreekey_in);

contrib/citext/citext.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
#include "utils/varlena.h"
1111
#include "varatt.h"
1212

13-
PG_MODULE_MAGIC;
13+
PG_MODULE_MAGIC_EXT(
14+
.name = "citext",
15+
.version = PG_VERSION
16+
);
1417

1518
/*
1619
* ====================

contrib/cube/cube.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
#include "utils/array.h"
1818
#include "utils/float.h"
1919

20-
PG_MODULE_MAGIC;
20+
PG_MODULE_MAGIC_EXT(
21+
.name = "cube",
22+
.version = PG_VERSION
23+
);
2124

2225
/*
2326
* Taken from the intarray contrib header

0 commit comments

Comments
 (0)