Postgres

Initial setup

Install server and client packages.

To access an admin shell, run:

sudo -u postgres psql

Create a database by running

sudo -u postgres createdb dbname

To create a non-privileged user, run

sudo -u postgres createuser -P username

Login to the database as this user by running

psql -h 127.0.0.1 -d dbname username