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
обсуждение исходный текст
Ответы Re: wrong behavior using to_char()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: wrong behavior using to_char()  (Jorge Godoy <jgodoy@gmail.com>)
Список pgsql-bugs
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
Дата:
Сообщение: Re: wrong behavior using to_char()