ALTER ... OWNER
ALTER ... OWNER updates the owner of an item.
|The identifier of the item you want to alter.
|The role name you want to set as the new owner.
You must be a member of the new owner role to alter the ownership of an object. You cannot alter the owner of an index. If you try, it will return successfully with a warning, but will not actually change the owner of the index. This is for backwards compatibility reasons. The index owner is always kept in-sync with the owner of the underlying relation.
ALTER TABLE t OWNER TO joe;
ALTER CLUSTER REPLICA production.r1 OWNER TO admin;
The privileges required to execute this statement are:
- Role membership in
- Ownership of the object being altered.
CREATEprivileges on the containing cluster if the object is a cluster replica.
CREATEprivileges on the containing database if the object is a schema.
CREATEprivileges on the containing schema if the object is namespaced by a schema.