Pg_restore: error: input file appears to be a text format dump. please use psql. dbeaver

The error message “pg_restore: error: input file appears to be a text format dump. please use psql. dbeaver” indicates that the input file you are trying to restore is in a text format, but the pg_restore command can only be used to restore binary format dumps. To resolve this issue, you should use the psql command or DBeaver tool instead of pg_restore.

The psql command is the PostgreSQL interactive terminal and can be used to execute SQL commands and restore text format dumps. To restore a text format dump using psql, you can use the following command:

    psql -U <username> -d <database> -f <input_file>
  

Replace <username> with your PostgreSQL username, <database> with the name of the database you want to restore to, and <input_file> with the path to your text format dump file. This command will execute the SQL commands in the input file and restore the database.

Alternatively, you can use DBeaver, a universal database tool that supports PostgreSQL and provides a visual interface for managing databases. To restore a text format dump using DBeaver, follow these steps:

  1. Launch DBeaver and connect to your PostgreSQL database.
  2. Right-click on your database in the DBeaver explorer and select “Restore”.
  3. In the “Restore Options” tab, select the “Custom” format.
  4. Choose the text format dump file you want to restore by clicking on the browse button.
  5. Click “Next” and review the restore options.
  6. Click “Finish” to start the restore process.

DBeaver will execute the SQL commands in the text format dump file and restore the database accordingly.

Make sure to adjust the commands and options based on your specific environment and requirements.

Leave a comment