Skip to main content
Kill -9 Club
Sign in

PostgreSQL cluster

Databases

One running PostgreSQL server: one data directory, one port, and the whole set of databases that share it. The word says nothing about a group of machines. On Ubuntu 24.04 the default cluster is named 16 main, listens alone on port 5432, keeps its data in /var/lib/postgresql/16/main and its configuration in /etc/postgresql/16/main, and pg_lsclusters lists every one you have. Read the word as several machines and you conclude that dumping each database captures everything. It does not: roles, their passwords and their memberships are cluster objects, held outside any database, and no pg_dump of a database contains them. The restore onto a fresh machine then stops on roles that do not exist, on an incident day. pg_dumpall --globals-only is what writes them out.

Also written: database cluster, instance