Backup
We backup each table to a separate dump file, using the command:-
Code Block | ||||
---|---|---|---|---|
| ||||
pg_dump.exe –Fc –table=<tablename> --username=postgres –file=<filename> |
...
Code Block | ||||
---|---|---|---|---|
| ||||
pg_restore.exe –dbname=<database> --exit-on-error –username=postgres <filename> |
...
Only when all tables have been successfully restored do we then go through and remove the backups.
Database
Each table is restored into the same database name that it came from, and this is ‘remembered’ in the control file.