How to change Owner of a Schema in Redshift database

You can view the current owner of a schema by running the below query where schema_name is the name of the schema.

select n.nspname, u.usename as owner from pg_namespace n, pg_user u where n.nspname='schema_name' and n.nspowner=u.usesysid;

Use the below command to change the owner of a schema where schema_name is the name of the schema and new_owner is the name of the owner.

ALTER SCHEMA schema_name OWNER TO new_owner;
See also  How to create AMI of an EC2 Instance

Leave a Reply

Your email address will not be published. Required fields are marked *