Skip to main content Skip to complementary content

Backing up and restoring a database on PostgreSQL

Back up and restore your PostgreSQL database with the Oracle Data Pump technology.
  • You have created a directory on your server machine to store all the exported files, such as .dump files.
  • You have stopped Talend Data Catalog application server before performing the backup and restore tasks.

Backing up using the pg_dump command

  1. Open a command prompt window.
  2. Execute the following command to backup your PostgreSQL database into a file:
    pg_dump -b -f <backup_directory_path>\<backup_file_name> -F t -d "<db_name>" -h <postgre_host> -w -p <postgre_port> -U <postgre_username>

Restoring using the pg_restore command

  1. Open a command prompt window.
  2. Execute the following command to restore the file into the database server:
    pg_restore -c -F t -d "<db_name>" -h <postgre_host> -w -p <postgre_port> -U <postgre_username> --if-exists <backup_directory_path>\<backup_file_name>

    All the database objects and data are dropped before recreating them.

  3. Restart Talend Data Catalog application server.
  4. To ensure the optimal Talend Data Catalog application server performance, go to MANAGE > Schedules to run the database maintenance script.
  5. Right-click Run Database Maintenance and click Run operation now to update the database indexes and statistics.

For more information on the pg_dump and pg_restore commands, refer to the PostgreSQL documentation.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!