Make PGLC_setlocale() static, and document that it can't be used safely
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 25 Nov 2000 22:43:08 +0000 (22:43 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 25 Nov 2000 22:43:08 +0000 (22:43 +0000)
commit24a6ab329aaad30aafa81d0579de8bcadce3c9ab
tree7b1c006114605747b8ae598907ccd8635579cf1a
parent6687cf3fa11a0ae8a6546a136c1a95b5633375ee
Make PGLC_setlocale() static, and document that it can't be used safely
for any other purpose than PGLC_localeconv()'s internal save/restore of
locale settings.  Fix cash.c to call PGLC_localeconv() rather than
making a direct call to localeconv() --- the old way, if PGLC_localeconv()
had already cached a locale result, it would be overwritten by the first
cash_in or cash_out operation, leading to wrong-locale results later.
Probably no demonstrable bug today, since we only appear to be looking
at the LC_MONETARY results which should be the same anyway, but definitely
a gotcha waiting to strike.
src/backend/utils/adt/cash.c
src/backend/utils/adt/pg_locale.c
src/include/utils/pg_locale.h