psql -U myapp_user -d myapp_db < backup.sql

Category: Self-Hosting

psql -U myapp_user -d myapp_db < backup.sql

Restore a PostgreSQL database from a SQL dump file

Restores a PostgreSQL database by replaying the SQL commands in the dump file.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.