pgsql: Fix to_char() to use ASCII-only case-folding rules where appropr

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix to_char() to use ASCII-only case-folding rules where appropr
Дата
Msg-id E1UCwCq-0001UE-GA@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix to_char() to use ASCII-only case-folding rules where appropriate.

formatting.c used locale-dependent case folding rules in some code paths
where the result isn't supposed to be locale-dependent, for example
to_char(timestamp, 'DAY').  Since the source data is always just ASCII
in these cases, that usually didn't matter ... but it does matter in
Turkish locales, which have unusual treatment of "i" and "I".  To confuse
matters even more, the misbehavior was only visible in UTF8 encoding,
because in single-byte encodings we used pg_toupper/pg_tolower which
don't have locale-specific behavior for ASCII characters.  Fix by providing
intentionally ASCII-only case-folding functions and using these where
appropriate.  Per bug #7913 from Adnan Dursun.  Back-patch to all active
branches, since it's been like this for a long time.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/7140cef24064ea43e1b6de2c5d45b5c0d95d5e16

Modified Files
--------------
src/backend/utils/adt/formatting.c |  138 +++++++++++++++++++++++++++++-------
src/include/utils/formatting.h     |    4 +
2 files changed, 117 insertions(+), 25 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix to_char() to use ASCII-only case-folding rules where appropr
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix to_char() to use ASCII-only case-folding rules where appropr