Restore
Restore a database with psql
$ psql -U user mydb < mydb\_backup.sql
Restore a database with pg_restore
$ pg\_restore -d mydb mydb\_backup.sql -c
- Â
-UÂ Specify a database user - Â
-c Drop database before recreating - Â
-CÂ Create database before restoring - Â
-e Exit if an error has encountered - Â
-FÂ Format (c: custom,d: directory,t: tar,p: plain text sql(default)) Usepg_restore -?to get the full list of options
Comments





