EPUB | CHM | PDF

TPSQLRestore.Methods.RestoreFromFile

Top Previous Next

Restores the database dump from the specified file.

Syntax:

procedure RestoreFromFile(const FileName: string; Log: TStrings);
procedure RestoreFromFile(const FileName, LogFileName: string); overload;

Description:

Call RestoreFromFile to restore the produced database dump by TPSQLDump or pg_dump from the file specified by FileName. Log messages will be placed in Log object, which must be created and maintained by application. TPSQLRestore can operate in two modes.

If DBName is specified, the archive is restored directly into the database. Otherwise, a script containing the SQL commands necessary to rebuild the database is created and written to a file specified by OutputFilename. The script output is equivalent to the plain text output format of TPSQLDump.

It's better to use the second function call, because in any case file for logging will be created due to the call agreements with pg_restore.dll library.

See also: OutputFileName, Options