Forrest logo
back to the pg_dumpall tool

pg_dumpall:tldr:f86ba

pg_dumpall: Dump only database data into an SQL-script file.
$ pg_dumpall --data-only > ${filename-sql}
try on your machine

This command is used to dump data-only backups of all databases in a PostgreSQL server. Here's a breakdown of the command:

  • pg_dumpall: This is the command line utility used to perform a logical backup of all databases in a PostgreSQL cluster.
  • --data-only: This option specifies that only the data from the databases should be dumped, excluding any schema or structural information like tables, indexes, etc. Only the data will be included in the backup.
  • >: This is a shell redirection operator that redirects the output of the command to a file.
  • ${filename-sql}: This is a placeholder for the name of the output file where the data backup will be stored. ${filename-sql} indicates that the name should be provided as an argument or variable when executing the command.

When this command is executed, the data from all databases will be dumped using pg_dumpall with the --data-only option. The resulting backup will be saved to a file specified by ${filename-sql}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pg_dumpall tool