4.2.1 Database User Permissions

Allow the trip user access to the database by editing the PostgreSQL database configuration:

$ sudoedit /etc/postgresql/13/main/pg_hba.conf

Insert a line, usually as the first non-comment line, to pg_hba.conf, with:

e.g

# TYPE  DATABASE        USER            ADDRESS                 METHOD
local   trip          trip                                  md5

Restart PostgreSQL:

$ sudo systemctl restart postgresql

Test connecting to the database as the trip user and create the pgcrypto extension.

$ psql -U trip -d trip
Password for user trip:
psql (13.5 (Debian 13.5-0+deb11u1))
Type "help" for help.

Whilst connected to the database, create the pgcrypto module:

trip=> CREATE EXTENSION pgcrypto;