Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mm28t-0008Rd-JY for pgsql-novice@arkaria.postgresql.org; Sat, 13 Nov 2021 23:09:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mm28M-00008u-4H for pgsql-novice@arkaria.postgresql.org; Sat, 13 Nov 2021 23:08:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlYuU-0004CZ-Fa for pgsql-novice@lists.postgresql.org; Fri, 12 Nov 2021 15:56:16 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlYuR-000470-6O for pgsql-novice@lists.postgresql.org; Fri, 12 Nov 2021 15:56:13 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 31B665C18BB for ; Fri, 12 Nov 2021 10:56:09 -0500 (EST) Received: from imap42 ([10.202.2.92]) by compute6.internal (MEProxy); Fri, 12 Nov 2021 10:56:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxy.se; h= mime-version:message-id:date:from:to:subject:content-type; s= fm3; bh=TArFrmJHNK3z/vEA2FfFAB6RGKInkbHTGLdfvMVGdW4=; b=cB1mWcJ7 c/tPODYYn2sEEpo807ktXk4KZxvU8ustvDfg9PD3hRKTTOMc+J6XrUZzwOcN6gVo nnii/M+wVwGi5poICYX8An0VcTTQ1v1BUg2lMFBEcoEdkqDg5lux5sILQ8D3CeBo MSAM7DNaIzPRcXqhWJRMnPipk3Bv2+IMrLDqegzOuepIXnupNeOLnJPBEWv4dP6R zjl1kc/LkhNY71GHveAx2O1w02h65SJdV68k9YhA+yHsscju+E+8U+0//i/g9Ai7 J6toSBgJNq9RGy+IU8qBomjjjjI8dvpXQWN/MBjY11oigeEEPgqZFAI/84XhCNM0 gCU0b+GLWhM27A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=TArFrmJHNK3z/vEA2FfFAB6RGKInk bHTGLdfvMVGdW4=; b=GF8tqKGCEMM9ktjPj29Fm1ALf5SmTyS8x+kG2Rma7i5rN WHSYlwc4hBRHGxv2OofTvH1GF8easIrvkOSi/vzMaIh1SnBoXaQBrgUwfBd34xfT f0MFQ2hJuhLNpHEJikxXRmC2ugT77cZk0/VStqNmdc77zKQDiTb+HlQSCyySFgXH KFPwINltgEUrKLHQ2H0Hg8F5nl344B2EDw8oCgoFqTUzol3f0bhammUsI4j65PoL UxuUZkifkIolEsIFsaqT3Zlw+fD1pf9HXEaBSwciwQU+Y+SoWkfxw0mg1/+T4Yz5 u3G1pBZfITM8A0EWYN2cZEx09Ae55XsJdw9LaGtqQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvdefgdejlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtredtre ertdenucfhrhhomhepfdfoihhkrggvlhcuufhtvghrnhgvrhdfuceomhhsthgvrhhnvghr sehmgiihrdhsvgeqnecuggftrfgrthhtvghrnheptdeiueeljeffuedtudffveejgedvve dvhfekhfeivedvgfeftefhkedutdehteefnecuffhomhgrihhnpehpohhsthhgrhgvshhq lhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmshhtvghrnhgvrhesmhighidrshgv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id EB4532180078; Fri, 12 Nov 2021 10:56:08 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1371-g2296cc3491-fm-20211109.003-g2296cc34 Mime-Version: 1.0 Message-Id: <34654dce-25fe-4d12-bf6e-b8b28a54b164@www.fastmail.com> Date: Fri, 12 Nov 2021 16:55:48 +0100 From: "Mikael Sterner" To: pgsql-novice@lists.postgresql.org Subject: Why clear pg_wal when recovering? Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi! In the guide at https://www.postgresql.org/docs/current/continuous-archiving.html#BACKUP-PITR-RECOVERY step 5 is to remove any files present in the pg_wal directory. Is this still the recommendation if the source of the file system restore in step 4 was a base backup generated by pg_basebackup? Because in that case, wouldn't the files in pg_wal still be needed to recover from the basebackup state? I guess these files that were removed would normally be restored from the WAL archive, but if you have for some reason lost your WAL archive, or it's not complete, wouldn't it be better if you had retained them in the restored data directory so that you could at least reach the state at the end of your latest base backup? Yours, Mikael