Use ALTER DEFAULT PRIVILEGES
to set privileges on objects created in the future, such as tables, views, sources, sinks, functions, schemas, and more. This removes the need to run GRANT
or REVOKE
manually each time a new object is created.
abbreviated_grant_or_revoke
is one of:
Parameter | Description |
---|---|
target_user | Change default privileges for objects created by target_user . If omitted, the current user is used. |
schema_name | The name of an existing schema. If specified, default privileges apply only to objects created in that schema; if omitted, privileges will be granted or revoked on all schemas in the current database. Note that IN SCHEMA is not allowed when setting default privileges on schemas, as schemas cannot be nested. |
user_name | The name of the existing user to grant or revoke privileges for. |