diff options
author | Jeff Davis <jdavis@postgresql.org> | 2024-11-06 14:44:35 -0800 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2024-11-06 14:44:35 -0800 |
commit | 8148e7124d550770e3a9064b9b45b354d783b949 (patch) | |
tree | c9f28fdba9a44f3c298ea2f67fd80f37b0dd4770 /src/backend | |
parent | b7467ab71c1982c120bb53811be4341730061212 (diff) | |
download | postgresql-8148e7124d550770e3a9064b9b45b354d783b949.tar.gz postgresql-8148e7124d550770e3a9064b9b45b354d783b949.zip |
Fix lc_collate_is_c() when LC_COLLATE != LC_CTYPE.
An unfortunate typo in commit 2d819a08a1 can cause wrong results when
the default collation provider is libc, LC_CTYPE=C, and LC_COLLATE is
a real locale. Users with this combination of settings must REINDEX
all affected indexes.
The same typo can also cause performance degradation when LC_COLLATE=C
and LC_CTYPE is a real locale.
Problem does not exist in master (due to refactoring), so fix only in
version 17.
Reported-by: Drew Callahan
Discussion: https://postgr.es/m/d5081a7f4f6d425c28dd69d1e09b2e78f149e726.camel@j-davis.com
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/utils/adt/pg_locale.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index cd5ad1e7056..4c85a01b284 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -1370,9 +1370,9 @@ lc_collate_is_c(Oid collation) } else if (default_locale.provider == COLLPROVIDER_LIBC) { - localeptr = setlocale(LC_CTYPE, NULL); + localeptr = setlocale(LC_COLLATE, NULL); if (!localeptr) - elog(ERROR, "invalid LC_CTYPE setting"); + elog(ERROR, "invalid LC_COLLATE setting"); } else elog(ERROR, "unexpected collation provider '%c'", |