pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Massimo Ortensi <mortensi@unimaticaspa.it>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Activate a standby database and then revert to standby
Date: Thu, 28 Oct 2021 11:41:07 +0200
Message-ID: <cce9a45811c96b38bf1774e41a6cf5877386b554.camel@cybertec.at> (raw)
In-Reply-To: <1mg1SF-000Mdb-9e@unimaticaspa.it>
References: <1mg1SF-000Mdb-9e@unimaticaspa.it>

On Thu, 2021-10-28 at 11:12 +0200, Massimo Ortensi wrote:
> I need to activate (open in read and write) a standby database, perform 
> some action and then revert it to the previous status of standby and 
> thus starting again loading wals from when it stopped.
> 
> How should I proceed to be sure it's possible to get "back in time" to 
> the standby db ?
> It's a huge DB and can't afford restarting sync from scratch

Yes.  For that, you have to enable "wal_log_hints" and set "wal_keep_size"
high enough.  Then you can use "pg_rewind" to restore the promoted standby
to a state when it can be a standby again.

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






view thread (3+ messages)  latest in thread

Message-ID: <cce9a45811c96b38bf1774e41a6cf5877386b554.camel@cybertec.at>
Permalink:  ../cce9a45811c96b38bf1774e41a6cf5877386b554.camel@cybertec.at/
Also on:    postgresql.org/message-id/cce9a45811c96b38bf1774e41a6cf5877386b554.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, mortensi@unimaticaspa.it, pgsql-admin@lists.postgresql.org
  Subject: Re: Activate a standby database and then revert to standby
  In-Reply-To: <cce9a45811c96b38bf1774e41a6cf5877386b554.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox