public inbox for [email protected]  
help / color / mirror / Atom feed
Collation again here
2+ messages / 2 participants
[nested] [flat]

* Collation again here
@ 2026-01-08 12:34 Rihad <[email protected]>
  2026-01-08 13:19 ` Re: Collation again here Daniel Verite <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Rihad @ 2026-01-08 12:34 UTC (permalink / raw)
  To: pgsql-general

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.
psql (18.1)
Type "help" for help.


(and I can't issue those same commands on the read-only replica).


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.


Thanks for any tips.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Collation again here
  2026-01-08 12:34 Collation again here Rihad <[email protected]>
@ 2026-01-08 13:19 ` Daniel Verite <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Daniel Verite @ 2026-01-08 13:19 UTC (permalink / raw)
  To: Rihad <[email protected]>; +Cc: pgsql-general

	Rihad wrote:

>DETAIL:  The database was created using collation version 43.0, but the 
> operating system provides version 34.0.

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

That would be the case if the database collation provider was ICU,
that is pg_database.datlocprovider = 'i'
Otherwise no, it's the libc version that matters, unless using
the binary-sorting C or C.UTF-8 collations.
43.0 and 34.0 don't look like ICU collation version numbers, so
they probably refer to FreeBSD libc (pg_database.datlocprovider = 'c')

As a general rule, you should indeed run the same OS version
for the primary and physical replicas.
Before Postgres version 15 this message did not exist, so the risks
of mismatch were silent but they existed just the same.


Best regards,
-- 
Daniel Vérité 
https://postgresql.verite.pro/






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-01-08 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-01-08 12:34 Collation again here Rihad <[email protected]>
2026-01-08 13:19 ` Daniel Verite <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox