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 search for files in S3 bucket folder using wildcard

Leave a Reply

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