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 1jXtjE-0004tf-Lj for pgsql-general@arkaria.postgresql.org; Sun, 10 May 2020 21:43:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jXtjD-0005kM-91 for pgsql-general@arkaria.postgresql.org; Sun, 10 May 2020 21:43:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jXtjD-0005kE-0r for pgsql-general@lists.postgresql.org; Sun, 10 May 2020 21:43:19 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jXtjA-0004br-QD for pgsql-general@postgresql.org; Sun, 10 May 2020 21:43:18 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id A20A01AFD for ; Mon, 11 May 2020 00:43:15 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nUlOIEsPJq6s for ; Mon, 11 May 2020 00:43:13 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost1.estpak.ee [213.180.2.79]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 73A61173D for ; Mon, 11 May 2020 00:43:13 +0300 (EEST) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost1.estpak.ee (Postfix) with ESMTPSA id 49KyH52dM3z2kr for ; Mon, 11 May 2020 00:43:12 +0300 (EEST) Message-ID: <79BA655C25F1470CAABE070E5F412813@dell2> From: "Andrus" To: "pgsql-general" Subject: How to restore database to previous state Date: Mon, 11 May 2020 00:43:05 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="windows-1257"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! Postgres 12 database is runing on Debian max_wal_size = 5GB is specified in postgres.conf file How to restore database to some previous state, e.q. before important data was accidently deleted. Binary asynchrunous replication with slot is also used. I looks like it is possible to create standby server which replicates changes using 24 hour delay and data directory backups in every night. However this requires separate delayed standby server . Is there simpler solution, e.q reverse playback of wal segments starting from current data directory contents. Andrus.