diff --git a/doc/src/sgml/ref/alter_role.sgml b/doc/src/sgml/ref/alter_role.sgml
index 67352c2..f0e7a9b 100644
--- a/doc/src/sgml/ref/alter_role.sgml
+++ b/doc/src/sgml/ref/alter_role.sgml
@@ -41,6 +41,10 @@ ALTER ROLE name SET co
ALTER ROLE name SET configuration_parameter FROM CURRENT
ALTER ROLE name RESET configuration_parameter
ALTER ROLE name RESET ALL
+
+ALTER ROLE name IN DATABASE database_name SET configuration_parameter { TO | = } { value | DEFAULT }
+ALTER ROLE name IN DATABASE database_name RESET configuration_parameter
+ALTER ROLE name IN DATABASE database_name SET configuration_parameter FROM CURRENT
@@ -80,14 +84,16 @@ ALTER ROLE name RESET ALL
- The remaining variants change a role's session default for a
- specified configuration variable. Whenever the role subsequently
+ The remaining variants change a role's session default for a configuration variable
+ for all databases or, when used with the variant of IN DATABASE,
+ for a specific database. Whenever the role subsequently
starts a new session, the specified value becomes the session
default, overriding whatever setting is present in
postgresql.conf> or has been received from the postgres
command line. This only happens at login time, so configuration
settings associated with a role to which you've will be ignored.
+ linkend="sql-set-role" endterm="sql-set-role-title"> will be ignored. Settings set to
+ a role directly are overridden by any database specific settings attached to a role.
Superusers can change anyone's session defaults. Roles having
CREATEROLE> privilege can change defaults for non-superuser
roles. Certain variables cannot be set this way, or can only be
@@ -146,6 +152,17 @@ ALTER ROLE name RESET ALL
+ database_name
+
+
+ The name of the database the configuration variable should be set in. Database-Role-specific
+ configuration settings are always applied after any other Role-specific settings, thus overriding
+ any role settings with the same configuration_parameter.
+
+
+
+
+
configuration_parameter
value
@@ -159,6 +176,8 @@ ALTER ROLE name RESET ALL
RESET ALL to clear all role-specific settings.
SET FROM CURRENT> saves the session's current value of
the parameter as the role-specific value.
+ If used in conjunction with IN DATABASE, the configuration
+ parameter is set or removed for the given role and database only.
@@ -207,8 +226,9 @@ ALTER ROLE name RESET ALL
It is also possible to tie a
session default to a specific database rather than to a role; see
.
- Role-specific settings override database-specific
- ones if there is a conflict.
+ The rule how conflicting settings are applied to a session then is the following:
+ Database-Role-specific settings override Role-specific settings and Role-specific
+ settings override Database-specific ones if there is a conflict.
@@ -263,6 +283,15 @@ ALTER ROLE miriam CREATEROLE CREATEDB;
ALTER ROLE worker_bee SET maintenance_work_mem = 100000;
+
+
+ Give a role a non-default, database-specific setting of the
+ parameter:
+
+
+ALTER ROLE fred IN DATABASE devel SET client_min_messages = DEBUG;
+
+