>_ IzzyLab

Topic breakdown

In PostgreSQL there's no separate "user" entity — there are roles, and an ordinary user is a role with the login attribute (LOGIN); without it the role turns into a group that you can't connect under directly. The password is a role attribute (PASSWORD), but by itself it doesn't grant access to databases: the right to connect to a specific database is an independent level, granted by a separate CONNECT privilege grant via GRANT. Mental model: having a role, the login right, and the right to a specific database are three orthogonal things, and skipping any one breaks the connection. The commands are run in psql as the superuser postgres.

What's checked

  1. role appuser with login privilege exists
  2. appuser has CONNECT on shop
  3. appuser logs into shop with the password secret

What it looks like