The pg_dump
utility is used to back up a PostgreSQL database. It does make consistent backups even if the database is being used by other transactions. Dumps can be created in script or in archive file formats. Script dumps are usually plain text files that contain the SQL commands required to reconstruct the database to the state it was in at the time it was saved. Script dumps can also be used to reconstruct the database on other machines and architectures.
Please note that the dump keyword is evenly used here as a synonym for backup.
The pg_dump
utility is considered to be a logical backup because it makes a copy of the data in the database by dumping out the contents of each table.
The basic syntax to take a logical backup of a single database is mentioned here:
pg_dump -U username -W -F t database_name > [Backup Location Path]
The usage of the options used with the pg_dump
command is explained here:
U switch: The
-U
switch...