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
pull/76/head
Tom Lane 4 years ago
parent 2ed8a8cc5b
commit 5609cc01c6
  1. 2
      contrib/auth_delay/auth_delay.c
  2. 2
      contrib/auto_explain/auto_explain.c
  3. 2
      contrib/pg_prewarm/autoprewarm.c
  4. 2
      contrib/pg_stat_statements/pg_stat_statements.c
  5. 2
      contrib/pg_trgm/trgm_op.c
  6. 2
      contrib/postgres_fdw/option.c
  7. 2
      contrib/sepgsql/hooks.c
  8. 8
      src/backend/utils/misc/guc.c
  9. 5
      src/include/utils/guc.h
  10. 2
      src/pl/plperl/plperl.c
  11. 2
      src/pl/plpgsql/src/pl_handler.c
  12. 4
      src/pl/tcl/pltcl.c
  13. 2
      src/test/modules/delay_execution/delay_execution.c
  14. 2
      src/test/modules/ssl_passphrase_callback/ssl_passphrase_func.c
  15. 2
      src/test/modules/worker_spi/worker_spi.c

@ -68,7 +68,7 @@ _PG_init(void)
NULL, NULL,
NULL); NULL);
EmitWarningsOnPlaceholders("auth_delay"); MarkGUCPrefixReserved("auth_delay");
/* Install Hooks */ /* Install Hooks */
original_client_auth_hook = ClientAuthentication_hook; original_client_auth_hook = ClientAuthentication_hook;

@ -231,7 +231,7 @@ _PG_init(void)
NULL, NULL,
NULL); NULL);
EmitWarningsOnPlaceholders("auto_explain"); MarkGUCPrefixReserved("auto_explain");
/* Install hooks. */ /* Install hooks. */
prev_ExecutorStart = ExecutorStart_hook; prev_ExecutorStart = ExecutorStart_hook;

@ -136,7 +136,7 @@ _PG_init(void)
NULL, NULL,
NULL); NULL);
EmitWarningsOnPlaceholders("pg_prewarm"); MarkGUCPrefixReserved("pg_prewarm");
RequestAddinShmemSpace(MAXALIGN(sizeof(AutoPrewarmSharedState))); RequestAddinShmemSpace(MAXALIGN(sizeof(AutoPrewarmSharedState)));

@ -437,7 +437,7 @@ _PG_init(void)
NULL, NULL,
NULL); NULL);
EmitWarningsOnPlaceholders("pg_stat_statements"); MarkGUCPrefixReserved("pg_stat_statements");
/* /*
* Request additional shared resources. (These are no-ops if we're not in * Request additional shared resources. (These are no-ops if we're not in

@ -101,7 +101,7 @@ _PG_init(void)
NULL, NULL,
NULL); NULL);
EmitWarningsOnPlaceholders("pg_trgm"); MarkGUCPrefixReserved("pg_trgm");
} }
/* /*

@ -532,5 +532,5 @@ _PG_init(void)
NULL, NULL,
NULL); NULL);
EmitWarningsOnPlaceholders("postgres_fdw"); MarkGUCPrefixReserved("postgres_fdw");
} }

@ -455,7 +455,7 @@ _PG_init(void)
NULL, NULL,
NULL); NULL);
EmitWarningsOnPlaceholders("sepgsql"); MarkGUCPrefixReserved("sepgsql");
/* Initialize userspace access vector cache */ /* Initialize userspace access vector cache */
sepgsql_avc_init(); sepgsql_avc_init();

@ -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 * 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 void
EmitWarningsOnPlaceholders(const char *className) MarkGUCPrefixReserved(const char *className)
{ {
int classLen = strlen(className); int classLen = strlen(className);
int i; int i;

@ -354,7 +354,10 @@ extern void DefineCustomEnumVariable(const char *name,
GucEnumAssignHook assign_hook, GucEnumAssignHook assign_hook,
GucShowHook show_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, extern const char *GetConfigOption(const char *name, bool missing_ok,
bool restrict_privileged); bool restrict_privileged);

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

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

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

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

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

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

Loading…
Cancel
Save