-- 创建资源队列: tpch1s=# CREATE ROLE fairyfar WITH LOGIN RESOURCE QUEUE queue1; CREATE ROLE -- 查询角色: tpch1s=# \du List of roles Role name | Attributes | Member of -----------+----------------------------------------------------------------------------------------------------------+----------- fairyfar | | {} gpadmin | Superuser, Create role, Create DB, Ext gpfdist Table, Wri Ext gpfdist Table, Ext http Table, Replication | {} -- 查询角色与资源队列关联关系: tpch1s=# SELECT rolname, rsqname FROM pg_roles, pg_resqueue WHERE pg_roles.rolresqueue = pg_resqueue.oid; rolname | rsqname ----------+------------ gpadmin | pg_default fairyfar | queue1 (2 rows) -- 可以尝试以下查询,试试效果: SELECT rolname, rsqname FROM pg_roles, gp_toolkit.gp_resqueue_status WHERE pg_roles.rolresqueue = gp_toolkit.gp_resqueue_status.queueid;