8000 Rename EmitWarningsOnPlaceholders() to MarkGUCPrefixReserved(). · postgrespro/postgres@5609cc0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5609cc0

Browse files
committed
Rename EmitWarningsOnPlaceholders() to MarkGUCPrefixReserved().
This seems like a clearer name for what it does now. Provide a compatibility macro so that extensions don't have to convert to the new name right away. Discussion: https://postgr.es/m/116024.1640111629@sss.pgh.pa.us
1 parent 2ed8a8c commit 5609cc0

File tree

15 files changed

+24
-17
lines changed

15 files changed

+24
-17
lines changed

contrib/auth_delay/auth_delay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ _PG_init(void)
6868
NULL,
6969
NULL);
7070

71-
EmitWarningsOnPlaceholders("auth_delay");
71+
MarkGUCPrefixReserved("auth_delay");
7272

7373
/* Install Hooks */
7474
original_client_auth_hook = ClientAuthentication_hook;

contrib/auto_explain/auto_explain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ _PG_init(void)
231231
NULL,
232232
NULL);
233233

234-
EmitWarningsOnPlaceholders("auto_explain");
234+
MarkGUCPrefixReserved("auto_explain");
235235

236236
/* Install hooks. */
237237
prev_ExecutorStart = ExecutorStart_hook;

contrib/pg_prewarm/autoprewarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ _PG_init(void)
136136
NULL,
137137
NULL);
138138

139-
EmitWarningsOnPlaceholders("pg_prewarm");
139+
MarkGUCPrefixReserved("pg_prewarm");
140140

141141
RequestAddinShmemSpace(MAXALIGN(sizeof(AutoPrewarmSharedState)));
142142

contrib/pg_stat_statements/pg_stat_statements.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ _PG_init(void)
437437
NULL,
438438
NULL);
439439

440-
EmitWarningsOnPlaceholders("pg_stat_statements");
440+
MarkGUCPrefixReserved("pg_stat_statements");
441441

442442
/*
443443
* Request additional shared resources. (These are no-ops if we're not in

contrib/pg_trgm/trgm_op.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ _PG_init(void)
101101
NULL,
102102
NULL);
103103

104-
EmitWarningsOnPlaceholders("pg_trgm");
104+
MarkGUCPrefixReserved("pg_trgm");
105105
}
106106

107107
/*

contrib/postgres_fdw/option.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,5 +532,5 @@ _PG_init(void)
532532
NULL,
533533
NULL);
534534

535-
EmitWarningsOnPlaceholders("postgres_fdw");
535+
MarkGUCPrefixReserved("postgres_fdw");
536536
}

contrib/sepgsql/hooks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ _PG_init(void)
455455
NULL,
456456
NULL);
457457

458-
EmitWarningsOnPlaceholders("sepgsql");
458+
MarkGUCPrefixReserved("sepgsql");
459459

460460
/* Initialize userspace access vector cache */
461461
sepgsql_avc_init();

src/backend/utils/misc/guc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9360,11 +9360,15 @@ DefineCustomEnumVariable(const char *name,
93609360
}
93619361

93629362
/*
9363+
* Mark the given GUC prefix as "reserved".
9364+
*
9365+
* This prints warnings if there are any existing placeholders matching
9366+
* the prefix, and then prevents new ones from being created.
93639367
* Extensions should call this after they've defined all of their custom
9364-
* GUCs, to help catch misspelled config-file entries,
9368+
* GUCs, to help catch misspelled config-file entries.
93659369
*/
93669370
void
9367-
EmitWarningsOnPlaceholders(const char *className)
9371+
MarkGUCPrefixReserved(const char *className)
93689372
{
93699373
int classLen = strlen(className);
93709374
int i;

src/include/utils/guc.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ extern void DefineCustomEnumVariable(const char *name,
354354
GucEnumAssignHook assign_hook,
355355
GucShowHook show_hook);
356356

357-
extern void EmitWarningsOnPlaceholders(const char *className);
357+
extern void MarkGUCPrefixReserved(const char *className);
358+
359+
/* old name for MarkGUCPrefixReserved, for backwards compatibility: */
360+
#define EmitWarningsOnPlaceholders(className) MarkGUCPrefixReserved(className)
358361

359362
extern const char *GetConfigOption(const char *name, bool missing_ok,
360363
bool restrict_privileged);

src/pl/plperl/plperl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ _PG_init(void)
453453
PGC_SUSET, 0,
454454
NULL, NULL, NULL);
455455

456-
EmitWarningsOnPlaceholders("plperl");
456+
MarkGUCPrefixReserved("plperl");
457457

458458
/*
459459
* Create hash tables.

0 commit comments

Comments
 (0)
0