The Personal Website of Jeremy Boles

PostgreSQL

A reliable open-source database, and the one I reach for.

PostgreSQL, usually just Postgres, is the database I default to.

Installation

On a Debian server it’s one command.

sudo apt install postgresql

Then you’ll want to tune it for the machine it’s on. Every application has different needs and every server is different, so there’s no set of numbers worth memorizing. I use PGTune to produce a starting point, halving both the total memory and the CPU count if I’m on a server that’s larger than the workload deserves.

Drop the result into a config file, substituting the major version you installed:

sudo vi /etc/postgresql/<version>/main/conf.d/pg_tune.conf
sudo systemctl restart postgresql

The Interactive Terminal

To administer the database and run SQL, use psql as the postgres user, which the Debian package creates for you.

sudo -u postgres psql