script to find the user part of which group in aws redshift database
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='redshiftuser1'
ORDER BY 1,2 ;
groname | grosysid | usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig
---------------------------+----------+------------+----------+-------------+----------+-----------+----------+----------+-----------
redshift_readonly_sa | 104 | TESTDB_user| 145 | f | f | f | ******** | |
redshift_readwrite_sa | 105 | TESTDB_user| 145 | f | f | f | ******** | |
No comments:
Post a Comment