$ doas pkg update
$ doas pkg install postgresql17-server
$ doas sysrc postgresql_enable=yes
$ doas service postgresql initdb
$ doas su - postgres
$ psql
psql (17.2)
Type "help" for help.
postgres=#
$ doas su - postgres
Password:
$ psql
psql (17.2)
Type "help" for help.
postgres=# CREATE DATABASE customers ;
CREATE DATABASE
postgres=# \c customers;
You are now connected to database "customers" as user "postgres".
customers=# create schema admindb authorization admindb ;
ERROR: role "admindb" does not exist
customers=# CREATE ROLE admindb ;
CREATE ROLE
postgres=# ALTER ROLE admindb LOGIN ;
ALTER ROLE
customers=# create schema admindb authorization admindb ;
CREATE SCHEMA
customers=# \q
$ exit
user@freebsd14-server:~ $ psql -U admindb customers
psql (17.2)
Type "help" for help.
customers=>