Skip to content

§ Databases · Relational

PostgreSQL backups, natively.

One custom-format archive per database plus a separate globals.sql for roles, streamed straight from pg_dump — nothing is staged on the server.

What Xtic runs

pg_dump
pg_dump -w -Fc --compress=none --lock-wait-timeout=120s -d "$db"

Shown with placeholders. Credentials never appear on a command line: they reach the tool through the environment, a file descriptor or a short-lived file in memory.

Restore paths

  • Original database: dropped and recreated from the archive with pg_restore
  • Under a new name: a fresh database created from template0, then pg_restore into it
  • Fresh instance: globals.sql first, then every database, then ANALYZE
  • Selective: chosen schemas or tables from the archive's table of contents

Verification

The archive header and exit code on every run; pg_restore --list and a full read in deep verification. Every artifact is also hashed, and the stored copy is read back and compared before the run counts as verified.

Version rule

pg_dump is at least the server's major version; restore to the same or a newer major.

Good to know

  • Roles live in globals.sql, not in a database dump — Xtic captures both
  • Extensions that need shared_preload_libraries (timescaledb, pg_cron) must be configured on the restore target; preflight compares them
  • TimescaleDB databases are dumped whole and restored with timescaledb_pre_restore / post_restore
  • Licence and editions: PostgreSQL licence — no edition gates.