List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------+----------- admin | Create role | {bob,bob} bob | | {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
First 'grant bob to admin' command issued immediately after creating role bob by superuser(grantor=10). Second command issues by admin role and set membership options SET and INHERIT.If we don't ready to display membership options with \du+ may be at least we must group records in 'Member of' column for \du command?
I agree that these views should GROUP BY roleid and use bool_or(*_option) to produce their result. Their purpose is to communicate the current effective state to the user, not facilitate full inspection of the configuration, possibly to aid in issuing GRANT and REVOKE commands.
One thing I found, and I plan to bring this up independently once I've collected my thoughts, is that pg_has_role() uses the terminology "USAGE" and "MEMBER" for "INHERIT" and "SET" respectively.
It's annoying that "member" has been overloaded here. And the choice of USAGE just seems arbitrary (though I haven't researched it) given the related syntax.