I am trying to restore my .sql backup of postgresql. I read its documents but I want to have clear simple command for importing my whole db (schema and data) into a new postgresql db.
-
1What you have tried? Just show that.Sarfaraz Makandar– Sarfaraz Makandar2014-07-24 10:35:47 +00:00Commented Jul 24, 2014 at 10:35
Add a comment
|
1 Answer
First of all you need to create a database with template name template0 and use:
Example:
c:\program files\postgresql\9.3\bin> psql -h localhost -p 5432
-U postgres newDBname < D:\backup.sql
Note: Be sure with template name as template0 and enter a new database name in place of newDBname.