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 view the sql history(recent queries) of a user in Redshift