Re: Is pg_basebackup also for "regular" backups?

Lists: pgsql-general
From: "Daniel Serodio (lists)" <daniel(dot)lists(at)mandic(dot)com(dot)br>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Is pg_basebackup also for "regular" backups?
Date: 2012-10-15 20:15:17
Message-ID: 507C6ED5.6010101@mandic.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I was reading the documentation for pg_basebackup and it states that
resulting backups "can be used both for point-in-time recovery and as
the starting point for a log shipping or streaming replication standby
servers".

Should pg_basebackup also be used for "regular" backups, or only for
PITR/streaming replication?

Regards,
Daniel Serodio


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Daniel Serodio (lists)" <daniel(dot)lists(at)mandic(dot)com(dot)br>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is pg_basebackup also for "regular" backups?
Date: 2012-10-15 20:38:01
Message-ID: CABUevEz3nDGpww1xpbrzAzc1WHU7S+Sisw1STX8L4zESZ-bMjg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, Oct 15, 2012 at 10:15 PM, Daniel Serodio (lists)
<daniel(dot)lists(at)mandic(dot)com(dot)br> wrote:
> I was reading the documentation for pg_basebackup and it states that
> resulting backups "can be used both for point-in-time recovery and as the
> starting point for a log shipping or streaming replication standby servers".
>
> Should pg_basebackup also be used for "regular" backups, or only for
> PITR/streaming replication?

It's for "regular backups", based off PITR.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: "Daniel Serodio (lists)" <daniel(dot)lists(at)mandic(dot)com(dot)br>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is pg_basebackup also for "regular" backups?
Date: 2012-10-15 21:06:52
Message-ID: 507C7AEC.8050605@mandic.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Magnus Hagander wrote:
> On Mon, Oct 15, 2012 at 10:15 PM, Daniel Serodio (lists)
> <daniel(dot)lists(at)mandic(dot)com(dot)br> wrote:
>> I was reading the documentation for pg_basebackup and it states that
>> resulting backups "can be used both for point-in-time recovery and as the
>> starting point for a log shipping or streaming replication standby servers".
>>
>> Should pg_basebackup also be used for "regular" backups, or only for
>> PITR/streaming replication?
>
> It's for "regular backups", based off PITR.
>
I'm sorry, I don't understand what you mean by "based off PITR". Do I
need PITR enabled in order to use pg_basebackup, or do you mean that I
won't lose the ability to use PITR after restoring from a backup created
with pg_basebackup, or do you mean something else?

Regards,
Daniel Serodio


From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Is pg_basebackup also for "regular" backups?
Date: 2012-10-15 21:28:22
Message-ID: 507C7FF6.4070509@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 10/15/12 2:06 PM, Daniel Serodio (lists) wrote:
> I'm sorry, I don't understand what you mean by "based off PITR". Do I
> need PITR enabled in order to use pg_basebackup, or do you mean that I
> won't lose the ability to use PITR after restoring from a backup
> created with pg_basebackup, or do you mean something else?

PITR is a recovery technique, allows you to restore the database to an
arbitrary point in time, not neccessarily the latest (so, for instance,
you can recover to just before your overzealous assistant adminstrator
made a total mess of your accounting system).

to utilize PITR, you need A) a base backup, and B) *all* the WAL
archives since that base backup was taken up to the point at which you
wish to recover.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is pg_basebackup also for "regular" backups?
Date: 2012-10-15 21:32:35
Message-ID: CABUevEyoy=D6MZpFofeMbEm39SAJSW1uy8iBLKgDLBwNLcW=Ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, Oct 15, 2012 at 11:28 PM, John R Pierce <pierce(at)hogranch(dot)com> wrote:
> On 10/15/12 2:06 PM, Daniel Serodio (lists) wrote:
>>
>> I'm sorry, I don't understand what you mean by "based off PITR". Do I need
>> PITR enabled in order to use pg_basebackup, or do you mean that I won't lose
>> the ability to use PITR after restoring from a backup created with
>> pg_basebackup, or do you mean something else?
>
>
>
> PITR is a recovery technique, allows you to restore the database to an
> arbitrary point in time, not neccessarily the latest (so, for instance, you
> can recover to just before your overzealous assistant adminstrator made a
> total mess of your accounting system).
>
> to utilize PITR, you need A) a base backup, and B) *all* the WAL archives
> since that base backup was taken up to the point at which you wish to
> recover.

You can also use pg_basebackup in -x mode in which case you don't need
a WAL archive - the required WAL will be included in the base backup.
This will not allow PITR though, but it will use the PITR technology
to do a one-off backup.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Thomas Endres <endres(dot)thomas(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is pg_basebackup also for "regular" backups?
Date: 2012-10-15 21:38:09
Message-ID: CABnS6Y1hc26XErNOpp1DbFBYj+hkgHM+e+9Gc9ULUKVcUgnA5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Take a look at the -x option - this solved an issue for me.
Quoting from 9.1:
"Includes the required transaction log files (WAL files) in the
backup. This will include all transaction logs generated during the
backup. If this option is specified, it is possible to start a
postmaster directly in the extracted directory without the need to
consult the log archive, thus making this a completely standalone
backup."

-tom

On Mon, Oct 15, 2012 at 4:06 PM, Daniel Serodio (lists)
<daniel(dot)lists(at)mandic(dot)com(dot)br> wrote:
> Magnus Hagander wrote:
>
> On Mon, Oct 15, 2012 at 10:15 PM, Daniel Serodio (lists)
> <daniel(dot)lists(at)mandic(dot)com(dot)br> wrote:
>
> I was reading the documentation for pg_basebackup and it states that
> resulting backups "can be used both for point-in-time recovery and as the
> starting point for a log shipping or streaming replication standby servers".
>
> Should pg_basebackup also be used for "regular" backups, or only for
> PITR/streaming replication?
>
> It's for "regular backups", based off PITR.
>
> I'm sorry, I don't understand what you mean by "based off PITR". Do I need
> PITR enabled in order to use pg_basebackup, or do you mean that I won't lose
> the ability to use PITR after restoring from a backup created with
> pg_basebackup, or do you mean something else?
>
> Regards,
> Daniel Serodio