Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. - Mailing list pgsql-committers

From Andrew Dunstan
Subject Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.
Date
Msg-id 0a364430-266e-1e1a-d5d8-1a5273c9ddb6@dunslane.net
Whole thread Raw
In response to pgsql: pg_upgrade: copy locale and encoding information to new cluster.  (Jeff Davis <jdavis@postgresql.org>)
Responses Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-committers


On 2023-03-09 Th 11:40, Jeff Davis wrote:
pg_upgrade: copy locale and encoding information to new cluster.

Previously, pg_upgrade checked that the old and new clusters were
compatible, including the locale and encoding. But the new cluster was
just created, and only template0 from the new cluster will be
preserved (template1 and postgres are both recreated during the
upgrade process).

Because template0 is not sensitive to locale or encoding, just update
the pg_database entry to be the same as template0 from the original
cluster.

This commit makes it easier to change the default initdb locale or
encoding settings without causing needless incompatibilities.


This looks like it broke cross version upgrade testing. Old versions don't have datlocprovider.


See <https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=crake&dt=2023-03-09%2016%3A47%3A03&stg=xversion-upgrade-REL9_2_STABLE-HEAD>:

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
SQL command failed
SELECT encoding, datlocprovider,        datcollate, datctype, daticulocale FROM	pg_catalog.pg_database WHERE datname='template0'
ERROR:  column "datlocprovider" does not exist
LINE 1: SELECT encoding, datlocprovider,        datcollate, datctype...                         ^

Failure, exiting


cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: pg_upgrade: copy locale and encoding information to new cluster.
Next
From: Jeff Davis
Date:
Subject: Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.