Hi there!

when upgrading postgres from 17 -> 18, following the pkg readme "Option
2: pg_upgrade" one ends up here:

------------------------------------------------------------------------
# su _postgresql -c "cd /var/postgresql && \
>     pg_upgrade -b /usr/local/bin/postgresql-17/ -B /usr/local/bin \
>     -U postgres -d /var/postgresql/data-17/ -D /var/postgresql/data"
Performing Consistency Checks
-----------------------------
Checking cluster versions                                     ok

old cluster does not use data checksums but the new one does
Failure, exiting
------------------------------------------------------------------------

I found two ways around this.

1. use --no-data-checksums during upgrade
-----------------------------------------
su _postgresql -c "mkdir /var/postgresql/data && cd /var/postgresql && \
    initdb -D /var/postgresql/data -U postgres -A scram-sha-256 -E UTF8 -W 
--no-data-checksums"

2. enable data checksums *before* the upgrade
---------------------------------------------
rcctl stop postgresql
su _postgresql -c '/usr/local/bin/pg_checksums -e -D /var/postgresql/data'
rcctl start postgresql


I suspect enabling data checksums is the preferred method as this seems
to be the default now? I think we should update the pkg-readme and / or
current.html.

Thanks,
Florian

-- 
In my defence, I have been left unsupervised.

Reply via email to