Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7LUL-0001uw-Oa for pgsql-general@arkaria.postgresql.org; Tue, 02 Oct 2018 14:17:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g7LUJ-0007MW-L2 for pgsql-general@arkaria.postgresql.org; Tue, 02 Oct 2018 14:17:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7DW7-000396-E2 for pgsql-general@lists.postgresql.org; Tue, 02 Oct 2018 05:46:43 +0000 Received: from mail3-163.sinamail.sina.com.cn ([202.108.3.163]) by magus.postgresql.org with smtp (Exim 4.89) (envelope-from ) id 1g7DW1-0005Nh-8i for pgsql-general@postgresql.org; Tue, 02 Oct 2018 05:46:40 +0000 Received: from unknown (HELO t460p)([123.158.111.62]) by sina.com with ESMTP id 5BB30631000062B9; Tue, 2 Oct 2018 13:46:25 +0800 (CST) X-Sender: wztdyl@sina.com X-Auth-ID: wztdyl@sina.com X-SMAIL-MID: 970806393282 Message-ID: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.com> Subject: how to identify the timeline of specified recovery_target_time when do multiple PITR From: magodo To: pgsql-general@postgresql.org Date: Tue, 02 Oct 2018 13:46:27 +0800 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I read the document about recovery configuration, it says: recovery_target_timeline (string) ... Other than that you only need to set this parameter in complex re- recovery situations, where you need to return to a state that itself was reached after a point-in-time recovery. See Section 25.3.5 for discussion. ... Andin section 25.3.5 it says: ... If you wish to recover into some child timeline (that is, you want to return to some state that was itself generated after a recovery attempt), you need to specify the target timeline ID in recovery.conf. ... 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? 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 Legend: BASE: basebackup A-Z: recovery point ---: active wal histroy (continuous among branches) ...: inactive wal history oN: point to do PITR If am at "o3", and I want to recover to "C", if I don't specify timeline ID, then i will ends up with state as "o1". Only if I specify timeline ID as "2", then I can get the state as I expect (as illustrated). Why not just recover along the history from timeline 1 to the timeline specified by recovery target? The only reason I can imagine is that there is a chance that there are two active timeline at same point, but what is the use case of that(if it exists)?