DROP ROLE command: Restriction on dropping the current primary role (Pending)¶
Attention
This behavior change is in the 2025_01 bundle.
For the current status of the bundle, refer to Bundle History.
When this behavior change bundle is enabled, the behavior of the DROP ROLE command changes as follows:
- Before the change:
Users can execute a DROP ROLE command that drops the current primary role. The current primary role is the role that is currently active for a session. For example, this role can be set with the USE ROLE command, defined as part of a user connection, or defined as the default role for a user.
- After the change:
Users can no longer execute a DROP ROLE command that drops the current primary role. An attempt to drop this role returns the following error:
SQL execution error: Cannot drop role <x> as it is the current primary role.
Reasons for this change¶
This change is being made because the current behavior has the following consequences:
Object ownership metadata is left in an inconsistent state when the current primary role is dropped.
Sessions that were using the dropped primary role are interrupted.
Preparation for this change¶
To prepare for this change, check all of your automated processes for use of the DROP ROLE command and make sure that these commands do not attempt to drop the current primary role. Also check your query history for any past instances of this behavior.
Ref: 1843