0

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.

1
  • 1
    What you have tried? Just show that. Commented Jul 24, 2014 at 10:35

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.