CertGrid CertGrid
Hands-on Lab·PostgreSQL

PostgreSQL Roles and Attributes

PostgreSQL has one object where other databases have two: a role is a user when it can log in and a group when it cannot. The `LOGIN` attribute is the only difference.

Roles and Authentication Guide 16 of 47 Beginner

Written against the versions above. `CREATE USER` still exists and is exactly `CREATE ROLE ... LOGIN`. The two-word distinction in older documentation describes syntax, not two kinds of object.

Every command on this page ran on db-a01.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 GB

Before you start

  1. List the roles and read their attributes

  2. Read the same thing from the catalogue

  3. Try to log in as a role that cannot

Official sources