From c26916e523dd7fd8381de0a16445c02bf27e2972 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Thu, 11 Mar 2021 22:18:30 +0000 Subject: [PATCH v5 1/1] Small documentation fix for SET ROLE. This change clarifies the behavior of RESET ROLE when "role" is set per-user, per-database, or via command-line options. Also, it adds additional information about setting "role" in these ways. --- doc/src/sgml/libpq.sgml | 12 ++++++++++++ doc/src/sgml/ref/alter_database.sgml | 10 ++++++++++ doc/src/sgml/ref/alter_role.sgml | 10 ++++++++++ doc/src/sgml/ref/set.sgml | 22 ++++++++++++++++++++++ doc/src/sgml/ref/set_role.sgml | 13 ++++++++++--- 5 files changed, 64 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 910e9a81ea..6d0539a18c 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1288,6 +1288,18 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname backslash. For a detailed discussion of the available options, consult . + + + In addition to the options listed in , + role may be used as a command-line option. While + setting role via command-line options modifies its + default setting for the session, such settings will not affect other + default settings for the session. The originally authenticated session + user is used to determine other session defaults. See + SET ROLE for + more information. + + diff --git a/doc/src/sgml/ref/alter_database.sgml b/doc/src/sgml/ref/alter_database.sgml index 81e37536a3..67e5a4b5f0 100644 --- a/doc/src/sgml/ref/alter_database.sgml +++ b/doc/src/sgml/ref/alter_database.sgml @@ -187,6 +187,16 @@ ALTER DATABASE name RESET ALL the parameter as the database-specific value. + + role may be used as a configuration parameter in this + command. While database-specific settings for role + modify its default setting for new sessions, such settings do not affect + other default settings for the session. The originally authenticated + session user is used to determine other session defaults. See + SET ROLE for more + information. + + See and for more information about allowed parameter names diff --git a/doc/src/sgml/ref/alter_role.sgml b/doc/src/sgml/ref/alter_role.sgml index 5aa5648ae7..5c4651e190 100644 --- a/doc/src/sgml/ref/alter_role.sgml +++ b/doc/src/sgml/ref/alter_role.sgml @@ -220,6 +220,16 @@ ALTER ROLE { role_specification | A parameter is set or removed for the given role and database only. + + role may be used as a configuration parameter in this + command. While role-specific settings for role + modify its default setting for new sessions, such settings do not affect + other default settings for the session. The originally authenticated + session user is used to determine other session defaults. See + SET ROLE for more + information. + + Role-specific variable settings take effect only at login; SET ROLE and diff --git a/doc/src/sgml/ref/set.sgml b/doc/src/sgml/ref/set.sgml index 339ee9eec9..631522e22c 100644 --- a/doc/src/sgml/ref/set.sgml +++ b/doc/src/sgml/ref/set.sgml @@ -258,6 +258,28 @@ SELECT setseed(value); + + + role + + + SET role TO value is an + alias for + SET ROLE. + + + + + + session_authorization + + + SET session_authorization TO value + is an alias for + SET SESSION AUTHORIZATION. + + + diff --git a/doc/src/sgml/ref/set_role.sgml b/doc/src/sgml/ref/set_role.sgml index 739f2c5cdf..f02babf3af 100644 --- a/doc/src/sgml/ref/set_role.sgml +++ b/doc/src/sgml/ref/set_role.sgml @@ -53,9 +53,16 @@ RESET ROLE - The NONE and RESET forms reset the current - user identifier to be the current session user identifier. - These forms can be executed by any user. + SET ROLE NONE sets the current user identifier to the + current session user identifier, as returned by + session_user. RESET ROLE sets the + current user identifier to the connection-time setting specified by the + command-line options, + ALTER ROLE, or + ALTER DATABASE, + if any such settings exist. Otherwise, RESET ROLE sets + the current user identifier to the current session user identifier. These + forms can be executed by any user. -- 2.16.6