Postgres (SQL) - Restore a Postgres database using the psql command
by
Jeremy Canfield |
Updated: September 11 2023
| Postgres (SQL) articles
This assumes you have already Backed a Postgres database using the pg_dump command.
Let's say you have created a file named foo.backup that contains a backup of the foo database.
pg_dump foo > /path/to/foo.backup
Here is how you can import (restore) the foo database using the psql command.
psql --username john.doe --dbname foo < /path/to/foo.backup
Did you find this article helpful?
If so, consider buying me a coffee over at