Re: How to duplicate postgres 9.4 database

From: srilinux <srilinux09(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to duplicate postgres 9.4 database
Date: 2017-07-22 23:43:43
Message-ID: CAFcfow-Dvzk8LvidArGF5VrQHoXyhFmnHR1Hi302rFYbqDfWvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 ?

Thank you
Sri

On Fri, Jul 21, 2017 at 4:08 PM, Igor Neyman [via PostgreSQL] <
ml+s1045698n5972447h56(at)n3(dot)nabble(dot)com> wrote:

> -----Original Message-----
> From: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5972447&i=0> [mailto:[hidden
> email] <http:///user/SendEmail.jtp?type=node&node=5972447&i=1>] On Behalf
> Of srilinux
> Sent: Friday, July 21, 2017 3:29 PM
> To: [hidden email] <http:///user/SendEmail.jtp?type=node&node=5972447&i=2>
> 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]
> <http:///user/SendEmail.jtp?type=node&node=5972447&i=3>)
> 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
> To unsubscribe from How to duplicate postgres 9.4 database, click here
> <http://www.postgresql-archive.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5972442&code=c3JpbGludXgwOUBnbWFpbC5jb218NTk3MjQ0MnwxNzYyMDg3MzUy>
> .
> NAML
> <http://www.postgresql-archive.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

--
View this message in context: http://www.postgresql-archive.org/How-to-duplicate-postgres-9-4-database-tp5972442p5972497.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Zehra Gül Çabuk 2017-07-25 06:18:29 Postgresql “alter column type” creates an event which contains “temp_table_xxx”
Previous Message Igor Neyman 2017-07-21 20:07:33 Re: How to duplicate postgres 9.4 database