Pg dump
lastmod 2026-11-10created 2022-09-165 edits
pg_dump is a command-line backup tool that exports a single PostgreSQL database to an SQL script or archive file. It reads a consistent snapshot while the server is running, so it does not block other connections. Saving in the -F c custom format allows selective per-table restores and parallel restores with pg_restore. To dump all databases and roles at once, use pg_dumpall. It is also used as a means of migrating data during version upgrades.