I was wondering if there is a way how to assign table owner to a group or to multiple users in Redshift? If not, is there any workaround you use to solve this need?
Thanks for any tips.
Adding user to the group To add an existing user to an existing group, run the following query in Redshift. ALTER GROUP group_name ADD USER user 1; The above query will add user_1 into an existing group group_name in the Redshift. Similarly, a user can be removed from a group in Redshift using the ALTER GROUP command.
To grant usage of external tables in an external schema, grant USAGE ON SCHEMA to the users that need access. Only the owner of an external schema or a superuser is permitted to create external tables in the external schema. To transfer ownership of an external schema, use ALTER SCHEMA to change the owner.
To view assigned roles to users in your Redshift cluster, you can use the following command: SELECT usename AS user_name, groname AS group_name FROM pg_user, pg_group WHERE pg_user.
Creating, altering, and deleting users To create a user, use the CREATE USER command. To create a superuser, use the CREATE USER command with the CREATEUSER option. To remove an existing user, use the DROP USER command. To change a user account, for example changing a password, use the ALTER USER command.
My understanding is that there is no way to achieve this seemingly desirable state. It seems to be how Redshift is designed.
The only work-around I am aware of is to either have the 'owner' of the object' execute any commands that required 'owner' privilege, or to have the owner run a command to transfer (note not 'confer' sadly) the ownership of the object to the target user that wishes to make modifications.
alter table test.test_table owner to test_user;
After executing the above, test_user will be the owner of test.test_table, and would be able to perform 'owner-only' commands such as alter/drop/vacuum etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With