Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1paJxf-0002MJ-Hb for pgsql-committers@arkaria.postgresql.org; Thu, 09 Mar 2023 17:21:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1paJxd-00035M-L0 for pgsql-committers@arkaria.postgresql.org; Thu, 09 Mar 2023 17:21:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1paJxd-00033o-9R for pgsql-committers@lists.postgresql.org; Thu, 09 Mar 2023 17:21:49 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1paJxV-0007oH-OP for pgsql-committers@lists.postgresql.org; Thu, 09 Mar 2023 17:21:47 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 8BC611BF206; Thu, 9 Mar 2023 17:21:36 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------f0Nuipuu6eI4u8YJgnUAbXgQ" Message-ID: <0a364430-266e-1e1a-d5d8-1a5273c9ddb6@dunslane.net> Date: Thu, 9 Mar 2023 12:21:35 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. To: Jeff Davis , pgsql-committers@lists.postgresql.org References: Content-Language: en-US From: Andrew Dunstan In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------f0Nuipuu6eI4u8YJgnUAbXgQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 : 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 --------------f0Nuipuu6eI4u8YJgnUAbXgQ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


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
--------------f0Nuipuu6eI4u8YJgnUAbXgQ--