Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: magodo <wztdyl(at)sina(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: how to identify the timeline of specified recovery_target_time when do multiple PITR
Date: 2018-10-10 16:21:15
Message-ID: 34d85bfc77e9a63890e28ea13953c30508233469.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

magodo wrote:
> > 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.
> >
> For me, the specified point corresponds to timeline 1, because at that
> time, the timeline is 1 indeed (when there is no timeline 2 branched
> out yet).
>
> So in other word, my expectation is like I want to get the first
> timeline which covers the specified time.
>
> As you mentioned, there is no active timeline concept in postgres, then
> what is the best practice to meet my expectation? Do I have to somehow
> record the timestamp when archived wal's timeline has been changed,
> then compare the specified recovery target time with those records to
> find the first timeline which covers that time?

As I wrote, that is the default behavior; PostgreSQL will stay on
the timeline that was active when recovery was started.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2018-10-10 16:50:02 Re: COPY threads
Previous Message Fabio Pardi 2018-10-10 15:31:00 Re: Pgbouncer discard all