Re: Creating a hot copy of PostgreSQL database

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Shreesha *EXTERN*" <shreesha1988(at)gmail(dot)com>, PGSQL-Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Creating a hot copy of PostgreSQL database
Date: 2014-07-22 10:18:19
Message-ID: A737B7A37273E048B164557ADEF4A58B17D1DD3D@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Shreesha wrote:
> I was wondering if pg_basebackup will be of any help for me in this regard.
> Can you please shed some light on how this can be used for recovery? Any examples(apart from the one
> in the documentation) on this usage especially with the 'xlog switch' would really help. I didn't find
> much usage examples of this utility over the internet. That's why thought of posting it here.

Yes, pg_basebackup will help.
Your script would call pg_basebackup with the -x flag so that you get a copy
of the database cluster that is ready for recovery (i.e., it contains all the
necessary WAL segments).

The server can then be started, and after recovery is completed, it will be
ready for operation. Do *not* remove the backup_label file before you start
the server.

I don't have such a script ready, but it should not be a problem.

Yours,
Laurenz Albe

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Paul Linehan 2014-07-23 09:47:20 Re: Help with a JOIN.
Previous Message Shreesha 2014-07-22 01:17:54 Re: Creating a hot copy of PostgreSQL database