next up previous contents
Next: Destroying a database Up: Managing databases Previous: Dumping a database   Contents


Restoring a database

To restore a database,

  1. Create a database without tables. See Section 6.2 ([*] page). The database name can be different from that of the source database. Caution : When creating a database for restoration, you should choose no in the Tables field on the Create Database dialog. Restoration will fail if the database to be restored has tables as the dump file includes the table definitions.
  2. If the database is created successfully, you will be connected to it automatically.
  3. Click the Restore button.
  4. The Select a dump file name dialog will pop up.
  5. Select a dump file and click the Open button.
  6. The Select encryption algorithm dialog will appear.
  7. Select an item among the radio buttons. Be sure to choose the algorithm the dumped database uses.
  8. You will be prompted for the encryption key if you have chosen bf or aes as the encryption algorithm. Be sure to type the encryption key with which the dumped database are encrypted.

At this step, the following command will be executed.

pg_restore -U postgres --dbname=database_name dump_file_name

It is necessary to set the PostgreSQL Directory item in the Preferences dialog properly for tkDerm to find the pg_restore file and execute the above command. See Section 14.4 ([*] page).

Caution : The dump file will be restored to the currently connected database irrespective of the selection in the database table on the Create & Drop Database dialog.


next up previous contents
Next: Destroying a database Up: Managing databases Previous: Dumping a database   Contents
manabu 2010-11-14