pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: magodo <wztdyl@sina.com>
To: pgsql-general@postgresql.org
Subject: Re: how to identify the timeline of specified recovery_target_time when do multiple PITR
Date: Wed, 03 Oct 2018 08:06:35 +0200
Message-ID: <0c552a0ee114314ceb026d65f75a98df3e8d22ff.camel@cybertec.at> (raw)
In-Reply-To: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.com>
References: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.com>

magodo wrote:
> I read the document about recovery configuration, it says:

[...]

> Therefore, suppose I am going to recover to a point of some child
> timeline, to identify the point, I have to specify either
> recovery_target_name or recovery_target_time, and also specify the
> recovery_target_timeline.
> 
> It is more like a tuple like (recovery_target_time,
> recovery_target_timeline), that specify a real point among all history
> branches. Am I understand this correctly?

I think you understood the concept well enough.

> If yes, what I want to ask is that, though the timeline is increasing
> between different recovery, but each timestamp corresponds to a
> timeline ID, one by one. So if I get a recovery_target_time, why should
> I still specify the recovery_target_timeline? 
> 
> Suppose following illustration:
> 
>          A     B
> BASE-----+-----+------o1 (recover to A)                              1
>          |     |           C
>          +.....|.......----+---o2 (regret, recover to B)             2
>                |           |    
>                +...........|..------o3 (regret again, recover to C)  3
>                            | 
>                            +........----                             4

Consider this       ^   point in time.
                    |

Suppose you specify this point in time as recovery_target_time.

Then it is not clear which of the timelines you want to follow.
The point of time exists in timeline 1, 2 and 3.

In other words, should recovery use the WAL from
0000000100000ABC00000012, 0000000200000ABC00000012 or 0000000300000ABC00000012?

By default, recovery will stay on the timeline where it started.
If you want to go to timeline 2 or 3, you have to specify
recovery_target_timeline.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





view thread (10+ messages)  latest in thread

Message-ID: <0c552a0ee114314ceb026d65f75a98df3e8d22ff.camel@cybertec.at>
Permalink:  ../0c552a0ee114314ceb026d65f75a98df3e8d22ff.camel@cybertec.at/
Also on:    postgresql.org/message-id/0c552a0ee114314ceb026d65f75a98df3e8d22ff.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, wztdyl@sina.com
  Subject: Re: how to identify the timeline of specified recovery_target_time when do multiple PITR
  In-Reply-To: <0c552a0ee114314ceb026d65f75a98df3e8d22ff.camel@cybertec.at>
  References: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.com> <0c552a0ee114314ceb026d65f75a98df3e8d22ff.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox