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?

frlan's user avatar
frlan
7,2953 gold badges36 silver badges72 bronze badges
askedJul 11, 2014 at 9:02
Sajeev's user avatar

1 Answer1

6

Try This:

CREATE DATABASE newdb WITH TEMPLATE olddb;

answeredJul 11, 2014 at 9:03
Thush's user avatar
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

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy 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.