Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sKGUs-009AQS-Iq for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2024 12:02:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sKGUq-005yJb-62 for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2024 12:02:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sKGUp-005yJR-Ri for pgsql-general@lists.postgresql.org; Thu, 20 Jun 2024 12:02:32 +0000 Received: from dverite2024.planet-service.net ([185.16.44.252] helo=mail.verite.pro) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sKGUo-002FOM-0Q for pgsql-general@lists.postgresql.org; Thu, 20 Jun 2024 12:02:31 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id 29F382C8408; Thu, 20 Jun 2024 14:02:27 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: Help. The database was created using collation version 2.17, but the operating system provides version 2.34. From: "Daniel Verite" To: "Dmitry O Litvintsev" Cc: "pgsql-generallists.postgresql.org" In-Reply-To: Date: Thu, 20 Jun 2024 14:02:23 +0200 Message-Id: <7e5c7d2b-e322-4133-a083-2f76898adff2@manitou-mail.org> X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dmitry O Litvintsev wrote: > WARNING: database "xxx" has a collation version mismatch > DETAIL: The database was created using collation version 2.17, but the > operating system provides version 2.34. > HINT: Rebuild all objects in this database that use the default collation > and run ALTER DATABASE xxx REFRESH COLLATION VERSION, or build PostgreSQL > with the right library version. This upgrade comprises the major change in GNU libc 2.28, so indeed text indexes created by 2.17 are very likely unsafe to use on your new server. See https://wiki.postgresql.org/wiki/Locale_data_changes > REINDEX database xxx=20 > ALTER DATABASE xxx REFRESH COLLATION VERSION > But this defeats the whole idea of having short downtime because REINDEX > will take forever.=20 The indexes that don't involve collatable types (text,varchar), and those that use the C collation don't need to be reindexed. Maybe you can reduce significantly the downtime by including only the ones that matter. The wiki page gives the query to obtain the list of affected indexes: SELECT DISTINCT indrelid::regclass::text, indexrelid::regclass::text, collname, pg_get_indexdef(indexrelid)=20 FROM (SELECT indexrelid, indrelid, indcollation[i] coll FROM pg_index, generate_subscripts(indcollation, 1) g(i)) s=20 JOIN pg_collation c ON coll=3Dc.oid WHERE collprovider IN ('d', 'c') AND collname NOT IN ('C', 'POSIX'); > I do not recall having similar issue when going from RH6 to RH7. This warning was added relatively recently, in Postgres 15 (october 2022). Best regards, --=20 Daniel V=E9rit=E9 https://postgresql.verite.pro/ Twitter: @DanielVerite