DBADMIN Role
Every database has the special DBADMIN role. A superuser (or someone with the PSEUDOSUPERUSER Role) can grant this role to or revoke this role from any user or role.
Users who enable the DBADMIN role gain these privileges:
- Create or drop users
- Create or drop schemas
- Create or drop roles
- Grant roles to other users
- View all system tables
- View and terminate user sessions
- Access to all data created by any user
The DBADMIN role does NOT allow users to:
- Start and stop a database
- Set configuration parameters
Note: A user with a DBADMIN role must have the ADMIN OPTION enabled to be able to grant a DBADMIN or PSEUDOSUPERUSER role to another user. . For more information see GRANT (Role).
You cannot assign additional roles to the DBADMIN role:
=> CREATE ROLE appviewer; CREATE ROLE => GRANT appviewer TO dbadmin; ROLLBACK 2347: Cannot alter predefined role "dbadmin"
You can, however, grant the DBADMIN role to other roles to augment a set of privileges. See Role Hierarchy for more information.
View a List of Database Superusers
To see who is a superuser, run the vsql \du command. In this example, only dbadmin is a superuser.
=> \du
List of users
User name | Is Superuser
-----------+--------------
dbadmin | t
Fred | f
Bob | f
Sue | f
Alice | f
User1 | f
User2 | f
User3 | f
u1 | f
u2 | f
(10 rows)