Setup for PostgreSQL DBAs
Setup is installing, upgrading and configuring a PostgreSQL server with a sound baseline. It covers package installation, initdb, directory layout, major version upgrades with pg_upgrade or logical replication, and the key postgresql.conf and pg_hba.conf settings. It is the first operational step on the PostgreSQL DBA path.
Stage: Installation and Configuration · Part of the PostgreSQL DBA roadmap · Last reviewed 19 November 2026
What to learn in Setup
- Install PostgreSQL from the official packages and initialise a cluster
- Edit postgresql.conf and reload settings without a restart where allowed
- Tell which parameters need a restart by checking the context column in pg_settings
- Plan a major version upgrade with pg_upgrade and a rollback path
- Restrict connections in pg_hba.conf by address, database and method
Setup interview questions
How do pg_upgrade and logical replication differ for a major version upgrade?
pg_upgrade converts the data directory in place, or with hard links using --link, so downtime is minutes but the service is stopped during it. Logical replication copies data to a new-version server while the old one runs, allowing a short cutover, but needs more setup and has limits on what replicates.
How can you check whether a setting change needs a restart?
Query pg_settings and read the context column: postmaster means a restart is required, sighup means a reload is enough, and user or superuser means it can be set per session. After editing, pg_reload_conf() applies reloadable changes, and pending_restart flags those waiting.
Where Setup fits in the PostgreSQL DBA roadmap
Setup belongs to the Installation and Configuration stage (intermediate level). Get a sane baseline.
Back to the full PostgreSQL DBA roadmap