Page 1 of 1
Posted: Tue 23 Dec 2008 14:30
Does the dump component have a way to restore? and is it compatible with the stock pg_dump.exe/pg_restore.exe?
I know it would create extra dependencies, but a component that was able to use pg_restore/pg_dump via create process would be the best way to go for a full featured backup/restore component. Or port pg_restore/pg_dump to Delphi
pg_dump/restore writes it's status messages to std error I believe, so you could have a event to show the progress by piping the std error.
Posted: Wed 24 Dec 2008 09:21
The TPgDump component creates SQL script as a result of dumping. The SQL property of TPgDump contains this script.
You can execute this script in several ways:
1) call the Restore method of TPgDump;
2) assign a value of the TPgDump.SQL property to the SQL property of TPgScript, and call the Execute method of TPgScript;
3) save SQL to a file, and execute it with psql or pg_restore applications.
TPgDump is not fully compatible with pg_dump.exe. It does not support dumping some objects, and does not support some options of pg_dump. The main purpose of the TPgDump component is to backup and restore one or several tables with data. For complex cases like full backup of the database, it is better to use the pg_dump.exe application.
We will not run pg_dump.exe from TPgDump. You you want to use pg_dump.exe, you can run it using your own code.