script to find out user part of which group in AWS Redshift:
you just need to feed the username and script will provide associated group name
SELECT
pg_group.groname
,pg_group.grosysid
,pg_user.*
FROM pg_group, pg_user
WHERE pg_user.usesysid = ANY(pg_group.grolist)
AND pg_user.usename='<user_name>'
ORDER BY 1,2 ;
No comments:
Post a Comment