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?