Skip to main content
Kill -9 Club
Sign in

dump (logical backup)

Backups

Not a copy of the database's files: a description of the data, produced by the server itself from one consistent image, that rebuilds the schema and the rows on restore. pg_dump --format=custom --file=/var/backups/mydb-2026-08-10.dump mydb reads inside a single transaction, so writes carry on throughout, the archive still holds one single instant, and pg_restore can pull one table out of it. Copying /var/lib/postgresql with cp -r while the server runs is not the same thing, however similar the result looks: you collect pages written at different moments, a transaction committed in one file and absent from another. That copy is not slightly old, it is inconsistent, and it will often refuse to start. Copying files is a physical backup, and it holds only with the server stopped.

Also written: logical backup, SQL dump