Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

How to copy a Postgres database within the same DB cluster?

$
0
0

I want to replicate a Postgres database without dumping data using pg_dump. Both source and target database are on the same machine (Test and Production server).

I would like to create a master_db_copy as exact copy of the production server master_db.

I tried from the command line:

pg_dump -vO master_db | gzip > master_db
gunzip -cV master_db.sql.gz | psql master_db_copy

Is there a better / faster way?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>