Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

How to copy (or create new one and copy) a PostgreSQL database to another (new) database? Is there any query based method for doing this?

share|improve this question
up vote 5 down vote accepted

Try This:

CREATE DATABASE newdb WITH TEMPLATE olddb;

share|improve this answer
    
@a_horse_with_no_name: but this is what OP asked for - copy whole database – mvp Jul 11 '14 at 9:12
    
Its the same I need. Thank you Thush. – Sajeev Jul 11 '14 at 9:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.