Re: WIP: to_char, support for EEEE format

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WIP: to_char, support for EEEE format
Дата
Msg-id 27622.1249353398@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 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 <direvus@gmail.com> writes:
> Well, I tried this and as it turns out the patch casts the value to a
> float8 in order to pass it on to snprintf for sci-notation formatting.

Well, that's pretty dumb.  Quite aside from the range problem, that
would mean that you lose everything past the sixteenth or so digit.
I think that's sufficient grounds for bouncing the patch back for
rework right there.

What I'd consider instead is calling numeric_out and then working
with the result of that.  It would always be f-format, so you'd
have to do your own conversion to e-format, but you could do it
without any risk of precision or range loss.
        regards, tom lane


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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: async notification patch for dblink
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_proc.probin should become text?