2

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?

1 Answer 1

6

Try This:

CREATE DATABASE newdb WITH TEMPLATE olddb;

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

2 Comments

@a_horse_with_no_name: but this is what OP asked for - copy whole database
Its the same I need. Thank you Thush.

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.