Installing on Arch Linux
The postgresql package from the official repositories (Extra) contains the server, the psql client, and the utilities. The installation creates the postgres system user, but does not create the cluster.
Initialize the cluster as the postgres user
You must initialize the data directory manually, and necessarily as the postgres user to guarantee the correct permissions:
sudo -iu postgres initdb -D /var/lib/postgres/dataOnce the cluster is created, enable and start the systemd service. The first connection is made with sudo -iu postgres psql.
Major upgrades
Arch follows the "rolling release" model and only offers the latest major version of PostgreSQL. When jumping a major version (for example 16 to 17), the format of the data directory changes: you will have to migrate with pg_upgrade or via a pg_dump / restore cycle. Always back up your data before such an upgrade — verify against the version.