Re: [SQL] How to duplicate postgres 9.4 database
От | srilinux |
---|---|
Тема | Re: [SQL] How to duplicate postgres 9.4 database |
Дата | |
Msg-id | CAFcfow-Dvzk8LvidArGF5VrQHoXyhFmnHR1Hi302rFYbqDfWvg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [SQL] How to duplicate postgres 9.4 database (Igor Neyman <ineyman@perceptron.com>) |
Ответы |
Re: [SQL] How to duplicate postgres 9.4 database
|
Список | pgsql-sql |
Thank you very much
I will try it , how much time will it take for 35gb database ? is this method suggest able for a 35gb database ?On Fri, Jul 21, 2017 at 4:08 PM, Igor Neyman [via PostgreSQL] <[hidden email]> wrote:
-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of srilinux
Sent: Friday, July 21, 2017 3:29 PM--To: [hidden email]
Subject: [SQL] How to duplicate postgres 9.4 database
Hi All
I want to duplicate the existing database , after reading documentation I used below command which just created database, but did not create data
CREATE DATABASE standby TEMPLATE template0;
my database is 35gb so dump and psql will take longer hours
is there an fastest way to copy database on same server , so that I can just modify pointing to the database and connect to the stanby one to do any testing ?
____________________________________________________________ ______________________________ ________________
As a TEMPLATE you should use the db that you want to copy, let's call it "source_db":
CREATE DATABASE standby TEMPLATE source_db;
Be aware, that when this statement runs there should be no user connections to source_db.
Regards,
Igor Neyman
Sent via pgsql-sql mailing list ([hidden email])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql If you reply to this email, your message will be added to the discussion below:http://www.postgresql-archive.org/How-to-duplicate-postgres- 9-4-database- tp5972442p5972447.html
View this message in context: Re: How to duplicate postgres 9.4 database
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
В списке pgsql-sql по дате отправления: