Skip to main content
Modifies the default privileges that apply to objects created in the future. Use ALTER DEFAULT PRIVILEGES to grant or revoke permissions that automatically apply to new schemas.
Only schemas are supported at this time. Default privileges for databases and tables are not currently available.
For more information, see Role-based access control.

Syntax

Parameters

Supported privileges

Only schema privileges can be granted using ALTER DEFAULT PRIVILEGES. The following privileges are supported: For more information about schema privileges, see Schema permissions.

Limitations

  • Scope: Default privileges are granted at the account scope only.
  • Object types: Only schemas are supported.

Notes

  • Default privileges only apply to objects created after the ALTER DEFAULT PRIVILEGES command is executed. Existing objects are not affected.
  • You must have the privilege you are granting in order to set it as a default privilege.
  • Only account administrators and role owners can modify default privileges.
  • Default privileges are stored in the information_schema.object_default_privileges view.
  • Default privileges apply to every schema created afterwards: the public schema of each new database, and every schema created with CREATE SCHEMA. They are not limited to new databases.
  • The built-in public role is a supported grantee here, and all schema privileges behave normally for it, but the statement additionally requires account_admin. Note that public already receives USAGE on each new database’s own public schema from a built-in grant, so a default USAGE for public adds nothing there — it is what reaches schemas created with CREATE SCHEMA. See public privileges.

Examples

Grant default USAGE privilege on future schemas The following example grants the USAGE privilege on all future schemas created by the current role to user_role:
Revoke default privileges The following example revokes the USAGE privilege on future schemas from user_role:
Grant all default privileges The following example grants all available privileges on future schemas to power_user_role:
  • RBAC guide - Provides overview of the system capabilities
  • GRANT - Grant privileges on existing objects
  • REVOKE - Revoke privileges from existing objects
  • CREATE ROLE - Create a new role