Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Jeff Davis <jdavis(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.
Date: 2023-03-09 17:21:35
Message-ID: 0a364430-266e-1e1a-d5d8-1a5273c9ddb6@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2023-03-09 17:35:35 Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.
Previous Message Jeff Davis 2023-03-09 16:40:38 pgsql: pg_upgrade: copy locale and encoding information to new cluster.