wrong behavior using to_char()

Поиск
Список
Период
Сортировка
Искать
От
Euler Taveira de Oliveira
Тема
wrong behavior using to_char()
Дата
Msg-id
3152.200.178.249.132.1158263640.squirrel@timbira.com
Список
Дерево обсуждения
wrong behavior using to_char() "Euler Taveira de Oliveira" <euler@timbira.com>
Re: wrong behavior using to_char() Tom Lane <tgl@sss.pgh.pa.us>
Re: wrong behavior using to_char() Bruce Momjian <bruce@momjian.us>
Re: wrong behavior using to_char() Peter Eisentraut <peter_e@gmx.net>
Re: wrong behavior using to_char() Bruce Momjian <bruce@momjian.us>
Re: wrong behavior using to_char() Jorge Godoy <jgodoy@gmail.com>
Re: wrong behavior using to_char() Euler Taveira de Oliveira <euler@timbira.com>
Hi,

I notice a strange behavior using to_char() function. I'm using locale
pt_BR but it could happen with any locale.


template1=# select to_char(12345.67, '999G999D999');
   to_char
--------------
   12,345,670
(1 registro)

In the pt_BR locale, the thousand separator is "". So it should return
12345,670. Looking at the source, I saw that the test cases for locale
properties are independent among them. I think that the correct form is to
have all-or-nothing test case or didn't test *lconv->property ("" is
evaluated to false). Attached is a patch that fixes it using the second
option.


-- 
  Euler Taveira de Oliveira
  http://www.timbira.com/
В списке pgsql-bugs по дате отправления
От: Bruce Momjian
Дата:
Сообщение: Re: pgsql on Solaris 10
От: Tom Lane
Дата:
FAQ