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.96) (envelope-from ) id 1vdrKE-005mp0-01 for pgsql-general@arkaria.postgresql.org; Thu, 08 Jan 2026 14:49:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vdrKC-002SCF-0f for pgsql-general@arkaria.postgresql.org; Thu, 08 Jan 2026 14:49:20 +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.96) (envelope-from ) id 1vdpuk-0027U2-21 for pgsql-general@lists.postgresql.org; Thu, 08 Jan 2026 13:18:59 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vdpui-005HRc-2L for pgsql-general@postgresql.org; Thu, 08 Jan 2026 13:18:59 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-383153e06d1so2762561fa.3 for ; Thu, 08 Jan 2026 05:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767878336; x=1768483136; darn=postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=XiMXDWTm21/ZsoOVNiGffvaF2QiUgj4ATs475kIZt9g=; b=LQZhtpfRCJJkGcClJqbxKUSJAN4/n11rUXpm0oaouyn0krEwzMiyLf24SEr/yIXH4C Eit+Dvxy3WuJjFxAYGN71GFdfotHczGzCqg+ZzpdPUdNT5m/X9aCtp0hwXkWwKfRN49k iXAAlPZ1FJrl+1dUPzBN4hyFxM0VufZF6hutWN2s/2JZLS6wD+XWK26urkdK+vd4TLjq EsJPnekwBE1S7ITdGhwUgPURMDDUTwEcCecEhHEeNkSwxQabxmk+Je1U/sxGVVp3LCCU mrMfh5CVEQZeu3OugBTucM18W593KFMF9tnoxvQXqn4QzubcNuts+Q/LHvj/OgI/h+wZ 3UIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767878336; x=1768483136; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XiMXDWTm21/ZsoOVNiGffvaF2QiUgj4ATs475kIZt9g=; b=U+6H4HmZy0vez5lvFGoynom8o+gzIYm0nCBbu5xrqvdZyrw1N+kF4p8xxpw1nbue1U djcy9H2rN0aHOo/G0uWqbr4BK6vs/fimVEdL0kmBXNnFjApaR2lDNq3f+u+gTsOx/E4u E39Ez2dSORZYL8pNLK+531LchlCAxko+4NLFYSFFGq4i5yGkfhYvPj2kM8eUbN3ccYT/ Z9AIBulfqVlliK49h5U8C/i5dcLjYpGOpHKGi168sCRW+JbYEXEOzelpdOcjkODPNbD9 8gKkSRbhKv7HdEUROwR56OZ8tVQMAv1mEPvkBdBcupCUHNLIR1DZdE7lG295nPrP2XBW OH/g== X-Gm-Message-State: AOJu0YwsN7OdVMs6kcKoBkPFJNt9VN7elTguS6TgndzPbZOaKBq6vdc6 gTu015kbv4DTkNoQ+R9mLRpmhJVfH1PZgDzkZOVHXswWUsru1UwdfiTL X-Gm-Gg: AY/fxX69C9n7ybI3jr29BcVNF/Qlvmbd2JH6wlhimN3Vz1bb93pPpJAzukUHBTs0UAv Slfk/i8G1kl7l+iStBjvXkYjw/OUjKsoHRHYSnYurmtcgmIoxOGQ4kRHX3pKAhsUnyaplgf/XPP HHWiNonZNoOybOfnt19FKiWUBls5/wcOUBq/4jKC3Igdpxlkeb0wRd0DcIYxmB5TLJUPAfZlkel 4SKlDZmwjuxo3fTv1sJNTy9yecOhV0ZAx/H+Mns9zaKj1iC3XuvJnH10h1DzNA3f40dd3TRMijd h9j6DgLaYvDEQADn6P8QIy0/tzgvvLn0LMD1Y95puh+8xUiS/WHooUd4hAzOoocXiH2FqGLK2Dm R3Gf9mn41AqqGhY7lgmzK/zrLt6b/yuhi00Nwk1OQaf1USFNOdUNGNn3d/XZweZfqaTiUQbwPM4 y9hLkB6KX5 X-Google-Smtp-Source: AGHT+IFu01YcI5naF/fry0865CwwK8KFwZHnZsPEKREAkdvVbLjP43/baBnvFAv6B2HR1GiDdxERzw== X-Received: by 2002:a05:6512:238c:b0:59b:794e:dff4 with SMTP id 2adb3069b0e04-59b794ee18dmr645794e87.48.1767878335842; Thu, 08 Jan 2026 05:18:55 -0800 (PST) Received: from [192.168.1.37] ([85.132.53.122]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59b6b606408sm1670002e87.11.2026.01.08.05.18.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jan 2026 05:18:55 -0800 (PST) Content-Type: multipart/alternative; boundary="------------Pd0nx16ieba90iX0pJAiLukC" Message-ID: <9f5996c1-abab-40da-8dd5-d56f483b22b1@gmail.com> Date: Thu, 8 Jan 2026 17:18:53 +0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Collation again here To: Dominique Devienne Cc: pgsql-general General References: <200eccb1-188e-49ee-9360-c3a7acb19c2c@gmail.com> Content-Language: en-US From: Rihad 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. --------------Pd0nx16ieba90iX0pJAiLukC Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/8/26 4:48 PM, Dominique Devienne wrote: > On Thu, Jan 8, 2026 at 1:39 PM Rihad wrote: >> Hi, guys. Just pg_upgraded our PG from 13.x to 18.1, rebuilt all indexes concurrently and issued ALTER DATABASE foo REFRESH COLLATION VERSION >> Everything's fine on the master server, no warnings etc. Then I set up a replica using pg_basebackup, and there when trying to access the DB using psql I get: >> >> WARNING: database "foo" has a collation version mismatch >> DETAIL: The database was created using collation version 43.0, but the operating system provides version 34.0. >> HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE foo REFRESH COLLATION VERSION, or build PostgreSQL with the right library version. >> The OS are both FreeBSD, but the master runs 14.3, the replica runs 13.5. PostgreSQL packages are built with ICU support by default, the versions used are identical: icu-76.1 >> Could it be that the OS (libc) needs to be the same version? I hoped it would be enough to use the same ICU. > Depends what Provider you used in those DBs: > https://www.postgresql.org/docs/current/locale.html#LOCALE-PROVIDERS > Having the same ICU is good, but do your DBs use that provider? If > not, and you're using the libc one, then yes, the libc version > matters. > Myself I use the new builtin provider to avoid OS portability issues. --DD Hi, our locale/collate/whatever is en_US.UTF-8 (as set by these pg_upgrade flags: --encoding=utf-8 --locale=en_US.UTF-8) Looking into pg_collation system table that collation has collprovide="c". First I thought "c" meant libc, but this article states that "c" means PG Internal provider, and libc would have been "l". https://medium.com/@adarsh2801/understanding-collations-in-postgresql-648e4fa333e1 1. */PostgreSQL Internal Provider (‘c’) /*: Introduced in Postgres 15. This built-in collation support is System/OS agnostic. 2. */System Library Provider (‘l’) : /*Uses GNU C library and hence is OS locale dependent. 3. */ICU — International Components for Unicode (‘i’) : /*Uses ICU library for unicode-aware collation. We only have "i" & "c" in pg_collation. And we aren't using any of "i" it seems. All this locale/encoding/collate stuff is too much for me to handle, sorry) So if we are using the internal (builtin) "c" provider how come the PG 18.1 run on FreeBSD 13.5 version shows warnings that the system version is 34.0? The article must be wrong I guess. Then upgrading 13.5 to 14.3 is our only option. --------------Pd0nx16ieba90iX0pJAiLukC Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 1/8/26 4:48 PM, Dominique Devienne wrote:
On Thu, Jan 8, 2026 at 1:39 PM Rihad <grihad@gmail.com> wrote:
Hi, guys. Just pg_upgraded our PG from 13.x to 18.1, rebuilt all indexes concurrently and issued  ALTER DATABASE foo REFRESH COLLATION VERSION
Everything's fine on the master server, no warnings etc. Then I set up a replica using pg_basebackup, and there when trying to access the DB using psql I get:

WARNING:  database "foo" has a collation version mismatch
DETAIL:  The database was created using collation version 43.0, but the operating system provides version 34.0.
HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE foo REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
The OS are both FreeBSD, but the master runs 14.3, the replica runs 13.5. PostgreSQL packages are built with ICU support by default, the versions used are identical:  icu-76.1
Could it be that the OS (libc) needs to be the same version? I hoped it would be enough to use the same ICU.
Depends what Provider you used in those DBs:
https://www.postgresql.org/docs/current/locale.html#LOCALE-PROVIDERS
Having the same ICU is good, but do your DBs use that provider? If
not, and you're using the libc one, then yes, the libc version
matters.
Myself I use the new builtin provider to avoid OS portability issues. --DD

Hi, our locale/collate/whatever is  en_US.UTF-8 (as set by these pg_upgrade flags: --encoding=utf-8 --locale=en_US.UTF-8)



Looking into pg_collation system table that collation has collprovide="c". First I thought "c" meant libc, but this article states that "c" means PG Internal provider, and libc would have been "l".

https://medium.com/@adarsh2801/understanding-collations-in-postgresql-648e4fa333e1

  1. PostgreSQL Internal Provider (‘c’) : Introduced in Postgres 15. This built-in collation support is System/OS agnostic.
  2. System Library Provider (‘l’) : Uses GNU C library and hence is OS locale dependent.
  3. ICU — International Components for Unicode (‘i’) : Uses ICU library for unicode-aware collation.


We only have "i" & "c" in pg_collation. And we aren't using any of "i" it seems. All this locale/encoding/collate stuff is too much for me to handle, sorry)

So if we are using the internal (builtin) "c" provider how come the PG 18.1 run on FreeBSD 13.5 version shows warnings that the system version is 34.0?

The article must be wrong I guess.

Then upgrading 13.5 to 14.3 is our only option.

--------------Pd0nx16ieba90iX0pJAiLukC--