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