Install pg
sudo apt-get install postgresql postgresql-contrib
Login as postgres and create the new user (dave in this example)
sudo -i -u postgres
createuser dave
psql
Allow our new user to create databases
ALTER USER dave WITH SUPERUSER;
\q
Allow local users to login without a password
exit
sudo su
cd /etc/postgresql/14/main/
cp pg_hba.conf pg_hba.conf.old
nano -w pg_hba.conf
Alter the file to look like this:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
Restart pg
service postgresql restart
exit
If you will be running tests locally, I recommending changing the following settings in main/postgresql.conf
:
fsync = off
full_page_writes = off
synchronous_commit = off