diff options
author | Tom Lane | 2018-03-22 00:11:07 +0000 |
---|---|---|
committer | Tom Lane | 2018-03-22 00:11:07 +0000 |
commit | 846b5a525746b83813771ec4720d664408c47c43 (patch) | |
tree | a1ec7ca6044e95d763172faab98f4da74ed4f0eb | |
parent | 742869946f4ff121778c2e5923ab51a451b16497 (diff) |
Prevent extensions from creating custom GUCs that are GUC_LIST_QUOTE.
Pending some solution for the problems noted in commit 742869946,
disallow dynamic creation of GUC_LIST_QUOTE variables.
If there are any extensions out there using this feature, they'd not
be happy for us to start enforcing this rule in minor releases, so
this is a HEAD-only change. The previous commit didn't make things
any worse than they already were for such cases.
Discussion: https://postgr.es/m/20180111064900.GA51030@paquier.xyz
-rw-r--r-- | src/backend/utils/misc/guc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 398680ab12c..153373ead02 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -7607,6 +7607,15 @@ init_custom_variable(const char *name, elog(FATAL, "cannot create PGC_POSTMASTER variables after startup"); /* + * We can't support custom GUC_LIST_QUOTE variables, because the wrong + * things would happen if such a variable were set or pg_dump'd when the + * defining extension isn't loaded. Again, treat this as fatal because + * the loadable module may be partly initialized already. + */ + if (flags & GUC_LIST_QUOTE) + elog(FATAL, "extensions cannot define GUC_LIST_QUOTE variables"); + + /* * Before pljava commit 398f3b876ed402bdaec8bc804f29e2be95c75139 * (2015-12-15), two of that module's PGC_USERSET variables facilitated * trivial escalation to superuser privileges. Restrict the variables to |