Re: old and new pg_controldata WAL segment sizes are invalid or donot match - Mailing list pgsql-admin

From Paul Förster
Subject Re: old and new pg_controldata WAL segment sizes are invalid or donot match
Date
Msg-id AB36E2E4-BBD3-4288-9AC9-E80C1E5869DD@gmail.com
Whole thread Raw
In response to old and new pg_controldata WAL segment sizes are invalid or do not match  (ram pratap maurya <rampratap0000@gmail.com>)
List pgsql-admin
Hi ram,

> On 17. Jun, 2020, at 23:05, ram pratap maurya <rampratap0000@gmail.com> wrote:
> old and new pg_controldata WAL segment sizes are invalid or do not match
> Failure, exiting

delete the *new* PostgreSQL cluster (it should be empty anyway) and reinitialize it setting the wal-segsize to the same
asthe old cluster: 

$ initdb --wal-segsize=<size> ...

(see https://www.postgresql.org/docs/current/app-initdb.html)

Then perform the upgrade as you tried before.

After that, you can, if you want, reset the size to a new one using pg_resetwal. But make sure you first do a really
cleanbackup! 

$ pg_resetwal --wal-segsize=<new_size> ...
(see https://www.postgresql.org/docs/current/app-pgresetwal.html)

But know what you're doing! Try on a test database first to see how it works.

Cheers,
Paul


pgsql-admin by date:

Previous
From: Jerry Sievers
Date:
Subject: Re: old and new pg_controldata WAL segment sizes are invalid or do not match
Next
From: Pepe TD Vo
Date:
Subject: Re: create batch script to import into postgres tables