PostgresDAC

TPSQLRestore

Previous Next

TPSQLRestore is a utility for restoring a PostgreSQL database from an archive created by TPSQLDump or pg_dump native utility in one of the non-plain-text formats. It will issue the commands necessary to reconstruct the database to the state it was in at the time it was saved. The archive files also allow TPSQLRestore to be selective about what is restored, or even to reorder the items prior to being restored. The archive files are designed to be portable across architectures.

TPSQLRestore can operate in two modes: If DBName property is not empty, the archive is restored directly into the database. (Large objects can only be restored by using such a direct database connection.) Otherwise, a script containing the SQL commands necessary to rebuild the database is created (and written to a file or TStrings object), similar to the ones created by the TPSQLDump plain text format. Some of the options controlling the script output are therefore analogous to TPSQLDump options.

Obviously, TPSQLRestore cannot restore information that is not present in the archive file. For instance, if the archive was made using the "dump data as INSERT commands" option, TPSQLRestore will not be able to load the data using COPY statements.

See also:Properties, Methods, Events