aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 6c74de41fc2..872be7623b5 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -7362,6 +7362,12 @@ set_config_option(const char *name, const char *value,
* expect that if "role" isn't supposed to be default, it
* has been or will be set by a separate reload action.
*
+ * Also, for the call from InitializeSessionUserId with
+ * source == PGC_S_OVERRIDE, use PGC_S_DYNAMIC_DEFAULT for
+ * "role"'s source, so that it's still possible to set
+ * "role" from pg_db_role_setting entries. (See notes in
+ * InitializeSessionUserId before changing this.)
+ *
* A fine point: for RESET session_authorization, we do
* "RESET role" not "SET ROLE NONE" (by passing down NULL
* rather than "none" for the value). This would have the
@@ -7374,7 +7380,9 @@ set_config_option(const char *name, const char *value,
(void) set_config_option("role",
value ? "none" : NULL,
orig_context,
- orig_source,
+ (orig_source == PGC_S_OVERRIDE)
+ ? PGC_S_DYNAMIC_DEFAULT
+ : orig_source,
action,
true,
elevel,