Re: WIP: to_char, support for EEEE format

Поиск
Список
Период
Сортировка
От Euler Taveira de Oliveira
Тема Re: WIP: to_char, support for EEEE format
Дата
Msg-id 4A68FAE4.50206@timbira.com
обсуждение исходный текст
Ответ на Re: WIP: to_char, support for EEEE format  (Brendan Jurd <direvus@gmail.com>)
Ответы Re: WIP: to_char, support for EEEE format  (Brendan Jurd <direvus@gmail.com>)
Список pgsql-hackers
Brendan Jurd escreveu:
> 2009/4/26 Brendan Jurd <direvus@gmail.com>:
>> I've done some work updating Pavel's sci notation patch for to_char().
> 
> That patch again, now with a couple of minor tweaks to make it apply
> cleanly against the current HEAD.
> 
Here is my review. The patch applied without problems. The docs and regression
tests are included. Both of them worked as expected. Also, you included a fix
in RN format, do it in another patch.

The behavior is not the same as Oracle. Oracle accepts an invalid scientific
notation '999.9EEEE'. Will we support it too? I think so.

euler=# SELECT to_char(1234.56789, '999.9EEEE');
ERRO:  invalid format for scientific notation
DETALHE:  "EEEE" requires exactly one digit before the decimal point.
DICA:  For example, "9.999EEEE" is a valid format.

TO_CHAR(1234.56789,'999.9EEEE')
------------------------------- 1.2E+03

1 rows selected

The '9.999eeee' format error message is misleading.

euler=# select to_char(123, '9.999eeee');
ERRO:  cannot use "EEEE" twice

You could include an example in manual too. You could add the two failing
cases above in regression tests too.


--  Euler Taveira de Oliveira http://www.timbira.com/


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: When is a record NULL?
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: When is a record NULL?