Re: Activate a standby database and then revert to standby

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Massimo Ortensi <mortensi(at)unimaticaspa(dot)it>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Activate a standby database and then revert to standby
Date: 2021-10-28 09:41:07
Message-ID: cce9a45811c96b38bf1774e41a6cf5877386b554.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Vijaykumar Jain 2021-10-28 09:50:40 Re: Activate a standby database and then revert to standby
Previous Message Massimo Ortensi 2021-10-28 09:12:10 Activate a standby database and then revert to standby