Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redshift: How to list all users in a group

Tags:

Getting the list of users belonging to a group in Redshift seems to be a fairly common task but I don't know how to interpret BLOB in grolist field.

I am literally getting "BLOB" in grolist field from TeamSQL. Not so sure this is specific to TeamSQL but I kind of remember thatI got a list of IDs there instead previously in other tool

like image 903
kee Avatar asked Aug 19 '18 01:08

kee


People also ask

How do I list Redshift users?

You can retrieve data about Amazon Redshift database users with the SVL_USER_INFO view.

How do you check groups in Redshift?

Using groups as roles in Redshift: 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. usesysid = ANY(pg_group.

What is Rdsdb user Redshift?

The user name rdsdb is used internally by Amazon Redshift to perform routine administrative and maintenance tasks. You can filter your query to show only user-defined user names by adding where usesysid > 1 to your SELECT statement.

How do I check user permissions in Redshift?

To view the permissions of a specific user on a specific schema, simply change the bold user name and schema name to the user and schema of interest on the following code. For a full list of every user - schema permission status, simply delete the entire WHERE clause. SELECT u. usename, s.


1 Answers

This worked for me:

select usename from pg_user , pg_group  where pg_user.usesysid = ANY(pg_group.grolist) and  pg_group.groname='<YOUR_GROUP_NAME>'; 
like image 77
Nav Avatar answered Oct 03 '22 07:10

Nav