... BTW, I wondered how come we'd missed noticing such a serious problem
in any testing. The code coverage report at
https://coverage.postgresql.org/src/backend/utils/adt/varlena.c.gcov.html
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?
regards, tom lane