Re: to_char/to_number loses sign

Поиск
Список
Период
Сортировка
От Karel Zak
Тема Re: to_char/to_number loses sign
Дата
Msg-id 1098711022.19187.26.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: to_char/to_number loses sign  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: to_char/to_number loses sign  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, 2004-10-23 at 17:25 -0400, Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > SELECT to_number('485-', '999S');
> >  to_number
> > -----------
> >        485
>
> > Is this a bug or intentional?
>
> Tracing through this, it looks like the problem is that NUM_processor()
> has no switch case for NUM_S (nor does the default case raise an error,
> which seems a risky practice to me).
>
> Karel, can you verify this and submit a fix?

Yes, you're right. It strange, but NUM_S missing there. The conversion
from string to number is less stable part of formatting.c...

I have already 2000 lines of code of new generation of to_..()
functions. But all will available in 8.1.

The patch is in the attachment.

    Karel

--
Karel Zak
http://home.zf.jcu.cz/~zakkr

Вложения

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

Предыдущее
От: Reini Urban
Дата:
Сообщение: Re: Proposed Query Planner TODO items
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Using ALTER TABLESPACE in pg_dump