1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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
This commit is contained in:
Tom Lane
2021-12-27 14:39:08 -05:00
parent 2ed8a8cc5b
commit 5609cc01c6
15 changed files with 24 additions and 17 deletions

View File

@ -9360,11 +9360,15 @@ DefineCustomEnumVariable(const char *name,
}
/*
* Mark the given GUC prefix as "reserved".
*
* This prints warnings if there are any existing placeholders matching
* the prefix, and then prevents new ones from being created.
* Extensions should call this after they've defined all of their custom
* GUCs, to help catch misspelled config-file entries,
* GUCs, to help catch misspelled config-file entries.
*/
void
EmitWarningsOnPlaceholders(const char *className)
MarkGUCPrefixReserved(const char *className)
{
int classLen = strlen(className);
int i;

View File

@ -354,7 +354,10 @@ extern void DefineCustomEnumVariable(const char *name,
GucEnumAssignHook assign_hook,
GucShowHook show_hook);
extern void EmitWarningsOnPlaceholders(const char *className);
extern void MarkGUCPrefixReserved(const char *className);
/* old name for MarkGUCPrefixReserved, for backwards compatibility: */
#define EmitWarningsOnPlaceholders(className) MarkGUCPrefixReserved(className)
extern const char *GetConfigOption(const char *name, bool missing_ok,
bool restrict_privileged);

View File

@ -453,7 +453,7 @@ _PG_init(void)
PGC_SUSET, 0,
NULL, NULL, NULL);
EmitWarningsOnPlaceholders("plperl");
MarkGUCPrefixReserved("plperl");
/*
* Create hash tables.

View File

@ -197,7 +197,7 @@ _PG_init(void)
plpgsql_extra_errors_assign_hook,
NULL);
EmitWarningsOnPlaceholders("plpgsql");
MarkGUCPrefixReserved("plpgsql");
plpgsql_HashTableInit();
RegisterXactCallback(plpgsql_xact_cb, NULL);

View File

@ -474,8 +474,8 @@ _PG_init(void)
PGC_SUSET, 0,
NULL, NULL, NULL);
EmitWarningsOnPlaceholders("pltcl");
EmitWarningsOnPlaceholders("pltclu");
MarkGUCPrefixReserved("pltcl");
MarkGUCPrefixReserved("pltclu");
pltcl_pm_init_done = true;
}

View File

@ -91,7 +91,7 @@ _PG_init(void)
NULL,
NULL);
EmitWarningsOnPlaceholders("delay_execution");
MarkGUCPrefixReserved("delay_execution");
/* Install our hook */
prev_planner_hook = planner_hook;

View File

@ -49,7 +49,7 @@ _PG_init(void)
NULL,
NULL);
EmitWarningsOnPlaceholders("ssl_passphrase");
MarkGUCPrefixReserved("ssl_passphrase");
if (ssl_passphrase)
openssl_tls_init_hook = set_rot13;

View File

@ -322,7 +322,7 @@ _PG_init(void)
0,
NULL, NULL, NULL);
EmitWarningsOnPlaceholders("worker_spi");
MarkGUCPrefixReserved("worker_spi");
/* set up common data for all our workers */
memset(&worker, 0, sizeof(worker));