How to list all the users of a group in Redshift database

Use the below sql query to list all the users of a group where groupname is the name of the group.

select u.usename from pg_user u , pg_group  g 
where u.usesysid = g.grolist 
and g.groname='groupname';

See also  How to Stop, Start, Reboot, Terminate EC2 Instances from AWS CLI