Replay a plain-text SQL dump with psql.
Section: pg_dump and pg_restore Basics
Restore plain SQL dump
bash
bash
psql -h localhost -U postgres -d appdb -f appdb.sqlExplanation
See summary for usage details.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing pg_dump and pg_restore Basics
Restore archive to database
Restore a custom or directory archive into a database.
Directory format dump
Create a directory-format dump that supports parallel restore.