Re: Strange results when casting string to double

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Strange results when casting string to double
Дата
Msg-id 4137023.1645214867@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Strange results when casting string to double  (Carsten Klein <c.klein@datagis.com>)
Список pgsql-general
Carsten Klein <c.klein@datagis.com> writes:
> So, you're not aware of any ways this behavior could be achieved from 
> within PostgreSQL? Something like a custom cast (actually, there is 
> none) or something that could intercept string to double conversion? 

Well, you asserted that these installations are all alike ... but
sure, it's conceivable that somebody could've replaced the default
numeric -> float8 cast (i.e., numeric_float8()) with some other code
that does it a bit inaccurately.  There's only a pg_cast entry
connecting that function to those types.  Have you tried stepping
through things with a debugger, to see if numeric_float8 and float8in
are actually reached on the problematic system?

> That would be something to look at closer. The question is: how would 
> you implement such an evil database wide text to double conversion (just 
> to kid users) if you had to?

At the SQL level, your example does not involve text -> double.
The literal 1.56 is of type numeric.

            regards, tom lane



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

Предыдущее
От: Carsten Klein
Дата:
Сообщение: Re: Strange results when casting string to double
Следующее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Strange results when casting string to double