TPSQLDump is a component for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently. TPSQLDump does not block other users accessing the database (readers or writers). Dumps can be output in script or archive file formats. The script files are in plain-text format and contain the SQL commands required to reconstruct the database to the state it was in at the time it was saved. For example, to restore these scripts, use TPSQLBatchExecute. They can be used to reconstruct the database even on other machines and other architectures, with some modifications even on other SQL database products. The alternative archive file formats that are meant to be used with TPSQLRestore or native pg_restore utility to rebuild the database, and they also allow to be selective about what is restored, or even to reorder the items prior to being restored. The archive files are also designed to be portable across architectures. When used with one of the archive file formats and combined with TPSQLRestore or pg_restore, TPSQLDump provides a flexible archival and transfer mechanism. TPSQLDump can be used to backup an entire database, then TPSQLRestore or pg_restore can be used to examine the archive and/or select which parts of the database are to be restored. The most flexible output file format is the "compressed archive" format, also know as "custom". It allows for selection and reordering of all archived items, and is compressed by default. The "tar archive" format is not compressed and it is not possible to reorder data when loading, but it is otherwise quite flexible; moreover, it can be manipulated with other tools such as tar. See also: Properties, Methods, Events |