Топ-100
 
logo-cerebrosql

Roles (groups) in PostgreSQL DBMS

A role is an entity that can own objects and have certain rights in the database;  

The CerebroSQL program introduced the separation of "Roles" for which it is forbidden to connect to the database (the login privilege was not granted) - they are displayed in the ROLES node and "Roles" for which connection to the database is allowed - are displayed in the USER node

PostgreSQL role list

SELECT r.oid, r.rolname,
      r.rolsuper::int,
      r.rolinherit::int,
      r.rolcreaterole::int,
      r.rolcreatedb::int,
      r.rolcanlogin::int,
      r.rolconnlimit,
      r.rolvaliduntil,
      ARRAY(SELECT b.rolname
               FROM pg_catalog.pg_auth_members m
                JOIN pg_catalog.pg_roles b ON (m.roleid = b.oid) 
             WHERE m.member = r.oid)::text as memberof,
      pg_catalog.shobj_description(r.oid, 'pg_authid') AS description, 
      r.rolreplication::int, 
      r.rolbypassrls::int
FROM pg_catalog.pg_roles r
 where rolcanlogin = false
ORDER BY 1

Menu

  • Copy name - copy the name of the selected role to the clipboard

  • Edit role - open role editor

  • Role Editor

    Role editor - show window

     

    Intuitive editor allows you to manage role settings and privileges