2.0 KiB
pg_dumpall
Caution
TODO
Command-line tool for creating backups of entire PostgreSQL clusters, and/or global objects like roles and
tablespaces.
Consider using pg_dump to create backups of a single database when nothing else is needed.
TL;DR
It can dump databases in their entirety, or just specific parts of them such as individual tables or schemas.
It can dump objects like roles, groups, tablespace and others.
It produces sets of SQL statements that can be executed to reproduce the original databases' object definitions and table data.
Suitable when:
- The databases' size is less than 100 GB.
It tends to start giving issues for bigger databases. - One plans to migrate the databases' metadata as well as the table data.
- There is a relatively large number of tables to migrate.
Important
pg_dumpallworks better when the database is taken offline, but it does keep the database available and will not prevent users from accessing it.
Even with other users accessing the database during the backup process,pg_dumpallwill always produce consistent results thanks to ACID properties.