Import SQL dump into PostgreSQL database Import SQL dump into PostgreSQL database postgresql postgresql

Import SQL dump into PostgreSQL database


psql databasename < data_base_dump

That's the command you are looking for.

Beware: databasename must be created before importing. Have a look at the PostgreSQL Docs Chapter 23. Backup and Restore.


Here is the command you are looking for.

psql -h hostname -d databasename -U username -f file.sql


I believe that you want to run in psql:

\i C:/database/db-backup.sql