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 1u4Hch-0007Tn-T5 for pgsql-general@arkaria.postgresql.org; Mon, 14 Apr 2025 11:05:08 +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 1u4Hcf-00H8v0-3T for pgsql-general@arkaria.postgresql.org; Mon, 14 Apr 2025 11:05:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u4Hce-00H8us-Nm for pgsql-general@lists.postgresql.org; Mon, 14 Apr 2025 11:05:05 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u4Hcc-00017k-00 for pgsql-general@lists.postgresql.org; Mon, 14 Apr 2025 11:05:05 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5eb92df4fcbso7316372a12.0 for ; Mon, 14 Apr 2025 04:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1744628702; x=1745233502; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=tRPqL1Nzcg5Tj8AgL1oHvIltczArJqCr5xvahyRAB/4=; b=fWrkLa7u/Iuh11tMkgATy1kUKnxkeH8mpXqVa7dpDmVkNkxmL4s/F0XaME7Fmgjpmr QvAFEkqo/eBA1/z4U319lIejKda/5aq4P1KTP3ty5LYmjSMcmMVNCtiX6P4bIWRKcRav h1EQjef1lMZkjvViOhrWnCI1xWIO9VkKvYWilEbZVHZrSYXEMuXHqq/IhtnuFSsywaSa OtzVpbVPv9t/GOk+DhlTed09YumsaplftuqF+JosEsXv7U48kw/nCQbvzH+9NRZUqQji +QTtHni2cxKsknGFW/Y92jehfSOuNjbwbmj3zdQtPgZHLTAZDA80Q9Pnohg9W+X6Yci5 Ou+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744628702; x=1745233502; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tRPqL1Nzcg5Tj8AgL1oHvIltczArJqCr5xvahyRAB/4=; b=KpbiJLOKGNSMfCScO9HETMTWzQtPVx7Ot/grpBG9bJTAipyPTkc7O9Ik+Exwr8EM9X YvOAoTl0n5ionrnZYhGR1cP9q08x41QT8rJHDcZPMwKQXnpaPszDlwKLxi/uRjVwrQZ1 /9eZT4Ec23FaZRJiIS/hsybzIK20hdjKRbtzNnevbAmudexNiXQ3Gie6H8tNtu3FPn8j DUNDN3cs40Fx0gHskmmDFJJrpFlhtxch+NftOPkeOIHSgEVglz5f3hBjX6nbBlbg44oD My0VCRfsjPZJnMGi/WUpcEq2Fyx1Vrv4Oykt0NHNPvjY0cshnzED7FjyO4E/48bv9c/0 a51Q== X-Forwarded-Encrypted: i=1; AJvYcCV0gzjUR7CCy7VUc+nJ9dLTLIq28xhvRc158n54LrLj8FIVc12K3gL+tZ3uiq9xkppO/EIVFqeWWw78GF+Z@lists.postgresql.org X-Gm-Message-State: AOJu0YzSIl1v5rzPC2DBe5NwlWDRo4NXKGShv3yvhcv+/D2JTfvW7ck7 Gi4fUwlIkSA0g05jJwEVlYjFiUXR/kwamNIVDVnkJYuuFIhwMJcdgg6hhUiXYYKL02ouRIJJBnR LMww= X-Gm-Gg: ASbGncsBfVn7Jo/jWuOUUBC0gLdrdO7Sc0gZjlVqPjuXYYPKhnHIY6LBwNxdwDjDe3c v6n9fZoM4A2XLzWLxyu54lnsM6BXJrWBcgSdVyZOLOv1DjvT3FqU0sAzn50YlG0FKynlb3jjSzP Z/oOoFPjRTFGi+AI1tGHxZdJphK9C1Sl0QQWRC1JgcM8mJChFqGu/eBaekSuetdpJRd/UqpkRWv EahcrsiCcQ7Zp2gPHG0yIvHrD7NbHSRCyhi415rq+I3IC4RGOC6XjZ6gp7cKuKS/y0Gfltgk+ai bMltOPP/vN12PTaJE+tv96b/4SAbz1UiDlq9fi+E/Y+qm+s4lSdH2BCtBlrU X-Google-Smtp-Source: AGHT+IHDWpKLgGckP3o/DRfhtvH6Nofb+dRU4TpcXj7c4AG0BHJCf5p6Vy00jj6JYInNGLlyshEPmQ== X-Received: by 2002:a17:907:8686:b0:ac7:e6c5:238e with SMTP id a640c23a62f3a-acad34dddfcmr913691966b.35.1744628701832; Mon, 14 Apr 2025 04:05:01 -0700 (PDT) Received: from localhost.localdomain ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-acaa1cb40d8sm888126066b.111.2025.04.14.04.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Apr 2025 04:05:01 -0700 (PDT) Message-ID: Subject: Re: ICU Collations and Collation Updates From: Laurenz Albe To: Thomas Michael Engelke , pgsql-general@lists.postgresql.org Date: Mon, 14 Apr 2025 13:05:01 +0200 In-Reply-To: <8ed41c50ba6c5322296b869e497c1b5573853b54.camel@posteo.de> References: <8ed41c50ba6c5322296b869e497c1b5573853b54.camel@posteo.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2025-04-14 at 08:28 +0000, Thomas Michael Engelke wrote: > Where I currently work my colleagues used libc collations before I > arrived. While using libc collations, they stumbled upon the collation > update problem after SLES updates (15.4 to 15.5) (collation version > difference for database and operating system) (paraphrased, don't have > the english message at the hand). >=20 > For an easy solution I suggested to switch to ICU collations. While > documenting the problem for older systems I realized that I did not > know enough about the problem to document why ICU collations would > solve this problem. >=20 > After reading https://www.postgresql.org/docs/17/collation.html this is > how I understand it: >=20 > When initdb creates a cluster the OS available collations are copied to > the database as database objects, listable using >=20 > select * from pg_collation; >=20 > Now, an OS collation update as part of the OS update will change the > collations available on the OS level, but not the collations that the > database uses. >=20 > Is my understanding correct then in that this way the database > collations never change, unless a manual intervention reinitialises the > collations and reindexes the database (or appropriate indexes)? How > does that process compare to other RDBMS? >=20 > Are regular collation updates deemed unnecessary for long running > database installations? Or do you people have maintenance workflows > that incorporate regular collation updates to the databases? PostgreSQL just copies the names and versions of the collations to the catalog. The actual collating is done by the C or ICU library. When you update the C library or ICU library and the version changes, you get warned by PostgreSQL and have to rebuild indexes. So the collations can change whenever you update the respective libraries. You would have to build PostgreSQL yourself with a fixed version of ICU that you never upgrade if you want to avoid the problem. Or you start using the POSIX collation. Yours, Laurenz Albe