From 9475db3a4eb5876b364254886d2730db01e042fd Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 17 Feb 2013 23:45:36 -0500 Subject: Add ALTER ROLE ALL SET command This generalizes the existing ALTER ROLE ... SET and ALTER DATABASE ... SET functionality to allow creating settings that apply to all users in all databases. reviewed by Pavel Stehule --- doc/src/sgml/ref/alter_role.sgml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_role.sgml b/doc/src/sgml/ref/alter_role.sgml index 2fbba53d25f..b0981fdd5d5 100644 --- a/doc/src/sgml/ref/alter_role.sgml +++ b/doc/src/sgml/ref/alter_role.sgml @@ -39,9 +39,9 @@ ALTER ROLE name [ [ WITH ] name RENAME TO new_name ALTER ROLE name [ IN DATABASE database_name ] SET configuration_parameter { TO | = } { value | DEFAULT } -ALTER ROLE name [ IN DATABASE database_name ] SET configuration_parameter FROM CURRENT -ALTER ROLE name [ IN DATABASE database_name ] RESET configuration_parameter -ALTER ROLE name [ IN DATABASE database_name ] RESET ALL +ALTER ROLE { name | ALL } [ IN DATABASE database_name ] SET configuration_parameter FROM CURRENT +ALTER ROLE { name | ALL } [ IN DATABASE database_name ] RESET configuration_parameter +ALTER ROLE { name | ALL } [ IN DATABASE database_name ] RESET ALL @@ -83,8 +83,15 @@ ALTER ROLE name [ IN DATABASE The remaining variants change a role's session default for a configuration variable, either for all databases or, when the IN - DATABASE clause is specified, only for sessions in - the named database. Whenever the role subsequently + DATABASE clause is specified, only for sessions in the named + database. If ALL is specified instead of a role name, + this changes the setting for all roles. Using ALL + with IN DATABASE is effectively the same as using the + command ALTER DATABASE ... SET .... + + + + 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 @@ -93,12 +100,17 @@ ALTER ROLE name [ IN DATABASE does not cause new configuration values to be set. Settings set for all databases are overridden by database-specific settings - attached to a role. + attached to a role. Settings for specific databases or specific roles override + settings for all roles. + + + Superusers can change anyone's session defaults. Roles having CREATEROLE privilege can change defaults for non-superuser roles. Ordinary roles can only set defaults for themselves. Certain configuration variables cannot be set this way, or can only be - set if a superuser issues the command. + set if a superuser issues the command. Only superusers can change a setting + for all roles in all databases. @@ -307,6 +319,7 @@ ALTER ROLE fred IN DATABASE devel SET client_min_messages = DEBUG; + -- cgit v1.2.3