Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite899df6

Browse files
committed
Repair assorted issues in locale data extraction.
cache_locale_time (extraction of LC_TIME-related info) had never beentaught the lessons we previously learned about extraction of info relatedto LC_MONETARY and LC_NUMERIC. Specifically, commit95a777c taughtPGLC_localeconv() that data coming out of localeconv() was in an encodingdetermined by the relevant locale, but we didn't realize that there's asimilar issue with strftime(). And commita4930e7 hardenedPGLC_localeconv() against errors occurring partway through, but failedto do likewise for cache_locale_time(). So, rearrange the latterfunction to perform encoding conversion and not risk failure whileit's got the locales set to temporary values.This time around I also changed PGLC_localeconv() to treat it as FATALif it can't restore the previous settings of the locale values. Thereis no reason (except possibly OOM) for that to fail, and proceeding withthe wrong locale values seems like a seriously bad idea --- especiallyon Windows where we have to also temporarily change LC_CTYPE. Also,protect against the possibility that we can't identify the codesetreported for LC_MONETARY or LC_NUMERIC; rather than just failing,try to validate the data without conversion.The user-visible symptom this fixes is that if LC_TIME is set to a localename that implies an encoding different from the database encoding,non-ASCII localized day and month names would be retrieved in the wrongencoding, leading to either unexpected encoding-conversion error reportsor wrong output from to_char(). The other possible failure modes areunlikely enough that we've not seen reports of them, AFAIK.The encoding conversion problems do not manifest on Windows, sincewe'd already created special-case code to handle that issue there.Per report from Juan José Santamaría Flecha. Back-patch to allsupported versions.Juan José Santamaría Flecha and Tom LaneDiscussion:https://postgr.es/m/CAC+AXB22So5aZm2vZe+MChYXec7gWfr-n-SK-iO091R0P_1Tew@mail.gmail.com
1 parent7f56d43 commite899df6

File tree

3 files changed

+201
-128
lines changed

3 files changed

+201
-128
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp