Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5kKN-003aHM-2l for pgsql-novice@arkaria.postgresql.org; Thu, 26 Mar 2026 13:00:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5kKM-002n5j-06 for pgsql-novice@arkaria.postgresql.org; Thu, 26 Mar 2026 13:00:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5kKL-002n5W-1x for pgsql-novice@lists.postgresql.org; Thu, 26 Mar 2026 13:00:46 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5kKJ-000000018q7-2IDQ for pgsql-novice@lists.postgresql.org; Thu, 26 Mar 2026 13:00:44 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-439b7c2788dso564615f8f.1 for ; Thu, 26 Mar 2026 06:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1774530042; x=1775134842; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=oLfb8BejOz5qBonJmf/75Rxr9ZFBZQZAc4f4fgq+yVc=; b=eHwkZA/VwWCyRO8lJQZ7cwQmpUd3WRS0Mxs78DOHhJRx939KvL/eXix/AA4iW86KRB Gd+3M2odEJBVr4boUXAcopnNQfCSlGNd9LplK19cFn8j/F98sH8R7uiJRNHxIMCtCJUt xYbZAHnW5o08XNwY+gmhiDg7DcWCCjqz1gNkA5iBRPsI4qhYzbbTVUUM4R3ctSMc1mTJ yZbeQgs0Kc6aF290ZXl4ixw68XfTDyuHcx+tRLMJzhXWwyqAnWf1csONTSH6I+xmmOE5 6rcZ4yii+X//1Uy+FCv5HVkAaCB2lHn9ovEXHE8vAnesF56FtezPNKY7w1cp4K0W3Rq7 esVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774530042; x=1775134842; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oLfb8BejOz5qBonJmf/75Rxr9ZFBZQZAc4f4fgq+yVc=; b=Etdi9H0skpIBoe8Vj9NgmbwlQGnIcYyp/Sz3W9u7nFhOgc13rTDDXpMoLPDcJiw79e 4EgXmqofyFx9hWq4zBGOqUDWS8sWEtPADl5i+a4U8dXOcKsg/UBE7/MopZ6OVgGjL++A YIR3E3a3CsdvT5TpOB7EanTJgNlqOy8/ldJiDzOff1Unu8RoUdm22BA+DzpHUr/xInKc 9YbXndR57Ezcssmsz0ctwzYI3fpFuePRLOcm2kB8B33+jo5E8IS+4lpPto3fA/VnZUjP sqlBZwN7lMVddbVVm2MvSh/lCTp179pdTr+UTegfRvdb/8guLmF02wlP7EquflDr+zLi Fkzg== X-Gm-Message-State: AOJu0YxJnI26RDQMLkFal6mnrRypy4Xz4VmvLKvcOSwUTBf0N/mAqxqJ v42gEO80Tl0Lzw6BvUqZVy/VecwLzcJDrcUBchMVw0+NjaZYXGiZJ67M+IC8TgQagIU= X-Gm-Gg: ATEYQzwdd0QJ8J50/WkZ7bN3jkk9GQiOAeDy5ZVYh9dYOW7cUMP1esD8aEE0SeSP7I1 +QGqxX1EteaVEYpi2fxeAtnbua/d4frYlleB/Vg+dK/qn4KGoY4gWOJw1wS7QODWB7UThOf2/Ht LW0SSzo1MXFmdAdqxoQFwN8eGZRvuLrMLlT7H6Dwrj5r4dRun34pNu6RxKNNDtJcoToewgFo4/T fK9yXEGEGo/SRX2SZyR1NF1i+xPOp0t2vqhMafymsiwk2xqWqumWhcr8x8ySPNgfdBX1gv2odWr rYkaTP3ktsASOZMLgSQ79h3wR92emudFhhI9cYhWHNKk1vqsWUl57gJBrkF9KL3YdbGF/riYNPn kDxtsAtzfGEKcYQCtDitBYodFILa1o6u9wegKmfWLckWULJnvDJlcwr98HskfAhCYW07y0ODtWj h0LgrAmpqGj439sZjbvPV+VAWJ6yObMbnQw0xCxICltV5SfvS7Rcdz0g== X-Received: by 2002:a05:6000:4212:b0:439:b811:11de with SMTP id ffacd0b85a97d-43b8898d479mr11206323f8f.7.1774530037833; Thu, 26 Mar 2026 06:00:37 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:70:1a44:6c8c:8b5f:2c65:962d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b919cf2b2sm8643799f8f.18.2026.03.26.06.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 06:00:37 -0700 (PDT) Message-ID: <8177cb9bc419f96f09302c50eb71d92723e01b9e.camel@cybertec.at> Subject: Re: AW: Very basic question about Archive logs From: Laurenz Albe To: "Subramanian,Ramachandran" , "David G. Johnston" Cc: "pgsql-novice@lists.postgresql.org" Date: Thu, 26 Mar 2026 14:00:36 +0100 In-Reply-To: <5604c5c610e44a0d97daceaf5f1ae01f@alte-leipziger.de> References: <5604c5c610e44a0d97daceaf5f1ae01f@alte-leipziger.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2026-03-26 at 12:38 +0000, Subramanian,Ramachandran wrote: > Just a theoretical question to better my understanding. If I take a backu= p > on Monday at 0100 Hours and never make any further Backups but hold on to > all the Logs ( Active and Archive), > I could theoretically go to any PIT =C2=A0between Monday 0100 Hours and N= OW? Yes. That is, if the backup *ended* at 1:00 a.m. > If I apply the base backup from Monday 0100 , how does Postgres know whic= h > Archive Logs need to be applied from it=E2=80=99s current state to get to= the PIT. > Obviously when the basebackup was taken, the now needed logs did not exis= t. > So this information cannot have been recorded during the backup. PostgreSQL knows where to start, because that is in the backup_label file. If recovery reaches the end of the current WAL segment, and we have not yet reached the recovery target, PostgreSQL will restore the next WAL segme= nt and continue recovery (actually, PostgreSQL prefetches WAL segments, but th= at doesn't affect the principle). Every commit record in the WAL has the commit timestamp, and that is how PostgreSQL can determine if it has reached the recovery target (if recovery_target_time was used). Yours, Laurenz Albe