Re: BUG #3686: Incorrect numeric type conversion to long in plpythonu
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #3686: Incorrect numeric type conversion to long in plpythonu |
| Дата | |
| Msg-id | 17901.1193008527@sss.pgh.pa.us обсуждение |
| Ответ на | BUG #3686: Incorrect numeric type conversion to long in plpythonu ("Sergi" <sergi.vladykin@googlemail.com>) |
| Список | pgsql-bugs |
"Sergi" <sergi.vladykin@googlemail.com> writes: > Problem is that numeric type converts to pythons long > incorrectly. Here is the simple script that shows this. The reason you're having a problem is that plpython translates PG's numeric datatype to Python Float type, and thus the precision is lost before the long() function ever sees it. We can't fix this by translating to Long instead, since that would lose fractional digits. We could consider translating to the Decimal type proposed in PEP 327 http://www.python.org/dev/peps/pep-0327/ however it appears that that's only standard in Python 2.4 and later which makes it rather a large portability problem. I have no idea what sort of backwards-compatibility issues such a change would create, either ... regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера