Top Previous Next

Specifies various behavioral properties of the TPSQLRestore.


TRestoreOption = (roDataOnly, roClean, roCreate, roExitOnError,
              roIgnoreVersion, roList, roNoOwner,
              roSchemaOnly, roVerbose, roNoPrivileges,
              roDisableTriggers, roUseSetSessionAuthorization,
              roSingleTransaction, roNoDataForFailedTables,
              roNoTablespaces, doIfExists, doEnableRowSecurity,
              roStrictNames, roNoSubscriptions, roNoPublications);
TRestoreOptions = set of TRestoreOption;
property Options: TRestoreOptions;


Set Options to include the desired properties for the restore. Options is a set drawn from the following values:


Restore only the data, not the schema (data definitions).


Clean (drop) database objects before recreating them. Unless doIfExists is used, this might generate some harmless error messages, if any objects were not present in the destination database.


   Use conditional commands (i.e. add an IF EXISTS clause) when cleaning database objects. This option is not valid unless doClean is also specified.


Create the database before restoring into it. (When this option is used, the database named with DBName property is used only to issue the initial CREATE DATABASE command. All data is restored into the database name that appears in the archive.)


Exit if an error is encountered while sending SQL commands to the database. The default is to continue and to display a count of errors at the end of the restoration.


A deprecated option that is now ignored.


List the contents of the archive to file with name specified by OutputFileName. The output file of this operation must be used with the ListFile property to restrict and reorder the items that are restored.


Do not output commands to set ownership of objects to match the original database. By default, TPSQLRestore issues SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail unless the initial connection to the database is made by a superuser (or the same user that owns all of the objects in the script). With roNoOwner, any user name can be used for the initial connection, and this user will own all the created objects.


Restore only the schema (data definitions), not the data. Sequence values will be reset.


Specifies verbose mode.


Prevent restoration of access privileges (GRANT/REVOKE commands).


This option is only relevant when performing a data-only restore. It instructs TPSQLRestore to execute commands to temporarily disable triggers on the target tables while the data is reloaded. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data reload. Presently, the commands emitted for roDisableTriggers must be done as superuser. So, you should also specify a superuser name with SuperUserName property, or preferably run TPSQLRestore as a PostgreSQL superuser.


Output SQL standard SET SESSION AUTHORIZATION commands instead of OWNER TO commands. This makes the dump more standards compatible, but depending on the history of the objects in the dump, may not restore properly.


This option instructs TPSQLRestore to run entire session in a single transaction.


Suppress loading data if table creation failed, because the table already exists. By default, table data objects are restored even if the associated table could not be successfully created (e. g. because it already exists). With this option, such table data is silently ignored. This is useful for dumping and restoring databases with tables which contain auxiliary data for PostgreSQL extensions (e. g. PostGIS).


Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.


This option is relevant only when restoring the contents of a table which has row security. By default, TPSQLRestore will set row_security to off, to ensure that all data is restored in to the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs TPSQLRestore to set row_security to on instead, allowing the user to attempt to restore the contents of the table with row security enabled. This might still fail if the user does not have the right to insert the rows from the dump into the table.

  Note that this option currently also requires the dump be in INSERT format, as COPY TO does not support row security.


Require that each schema (SchemaNames) and table (TableNames) match at least one schema/table in the backup file.


Do not output commands to restore subscriptions, even if the archive contains them.


Do not output commands to restore publications, even if the archive contains them.

See also: SuperUserName, ListFile, OutputFileName