From d885f72983ee75062e3336de623bb22e06482a89 Mon Sep 17 00:00:00 2001 From: Hunaid2000 Date: Thu, 16 Jan 2025 15:11:02 +0500 Subject: [PATCH v37 2/3] Mark role as GUC_REPORT Mark the role GUC as GUC_REPORT to ensure changes are communicated to the client. This is necessary for accurately reflecting the session's is_superuser status, as either the role or session authorization can influence it. This will support upcoming enhancements to the \conninfo+ meta-command, which will include more detailed session information, such as role and authorization. --- doc/src/sgml/libpq.sgml | 5 +++-- doc/src/sgml/protocol.sgml | 5 +++-- src/backend/utils/misc/guc_tables.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 370534e8a3..f8674603e3 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -2707,12 +2707,13 @@ const char *PQparameterStatus(const PGconn *conn, const char *paramName); session_authorization standard_conforming_strings TimeZone + role (default_transaction_read_only and in_hot_standby were not reported by releases before 14; scram_iterations was not reported by releases - before 16; search_path was not reported by releases - before 18.) + before 16; search_path and role + were not reported by releases before 18.) Note that server_version, server_encoding and diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index fb5dec1172..18083ded99 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1340,12 +1340,13 @@ SELCT 1/0; session_authorization standard_conforming_strings TimeZone + role (default_transaction_read_only and in_hot_standby were not reported by releases before 14; scram_iterations was not reported by releases - before 16; search_path was not reported by releases - before 18.) + before 16; search_path and role + were not reported by releases before 18.) Note that server_version, server_encoding and diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index 38cb9e970d..c34c78d2f8 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -4396,7 +4396,7 @@ struct config_string ConfigureNamesString[] = {"role", PGC_USERSET, UNGROUPED, gettext_noop("Sets the current role."), NULL, - GUC_IS_NAME | GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_NOT_WHILE_SEC_REST + GUC_IS_NAME | GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_NOT_WHILE_SEC_REST | GUC_REPORT }, &role_string, "none", -- 2.34.1