![]() If IN DATABASE is specified, the configuration parameter is set or removed for the given role and database only. SET FROM CURRENT saves the session's current value of the parameter as the role-specific value. Use RESET ALL to clear all role-specific settings. If value is DEFAULT or, equivalently, RESET is used, the role-specific variable setting is removed, so the role will inherit the system-wide default setting in new sessions. Set this role's session default for the specified configuration parameter to the given value. The name of the database the configuration variable should be set in. For more information, see the CREATE ROLE reference page. These clauses alter attributes originally set by CREATE ROLE. SESSION_USERĪlter the current session user instead of an explicitly identified role. ![]() ![]() CURRENT_ROLEĪlter the current user instead of an explicitly identified role. The name of the role whose attributes are to be altered. Only superusers can change a setting for all roles in all databases. Certain configuration variables cannot be set this way, or can only be set if a superuser issues the command. Ordinary roles can only set defaults for themselves. Roles having CREATEROLE privilege can change defaults for non-superuser roles. Superusers can change anyone's session defaults. Settings for specific databases or specific roles override settings for all roles. Settings set for all databases are overridden by database-specific settings attached to a role. This only happens at login time executing SET ROLE or SET SESSION AUTHORIZATION does not cause new configuration values to be set. Whenever the role subsequently starts a new session, the specified value becomes the session default, overriding whatever setting is present in nf or has been received from the postgres command line. Using ALL with IN DATABASE is effectively the same as using the command ALTER DATABASE. If ALL is specified instead of a role name, this changes the setting for all roles. 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. (Connect as a different user if you need to do that.) Because MD5-encrypted passwords use the role name as cryptographic salt, renaming a role clears its password if the password is MD5-encrypted. The current session user cannot be renamed. Roles having CREATEROLE privilege can rename non-superuser roles. The second variant changes the name of the role. Ordinary roles can only change their own password. Roles having CREATEROLE privilege can change any of these settings except SUPERUSER, REPLICATION, and BYPASSRLS but only for non-superuser and non-replication roles. Database superusers can change any of these settings for any role. (All the possible attributes are covered, except that there are no options for adding or removing memberships use GRANT and REVOKE for that.) Attributes not mentioned in the command retain their previous settings. The first variant of this command listed in the synopsis can change many of the role attributes that can be specified in CREATE ROLE. ALTER ROLE changes the attributes of a PostgreSQL role.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |