On Sat, Aug 13, 2022 at 11:15 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> says that only the "if (sss->collate_c)" path in varstr_abbrev_convert
> gets exercised in our regression tests. I thought maybe that just
> meant that the coverage.postgresql.org run uses C locale, but I see
> the same lack-of-coverage in a local test under LANG=en_US.utf8.
> How can we only be reaching this function with sss->collate_c true
> when the prevailing locale isn't that?
We don't trust libc's strxfrm() following the debacle with
locale-aware abbreviated keys back in 2016 (unless the user builds
their own Postgres, and goes out of their way to #define
TRUST_STRXFRM). So the relevant strxfrm() code is arguably dead code.
ICU is different: our policy with ICU locales has always been to trust
ICU's strxfrm()-like function to agree with ICU's strcoll()-like
function.
--
Peter Geoghegan