| От | Vicente Alabau Gonzalvo |
|---|---|
| Тема | numeric when compared to literal |
| Дата | |
| Msg-id | 3E3E6483.3060208@capgemini.es обсуждение исходный текст |
| Ответы |
Re: numeric when compared to literal
|
| Список | pgsql-sql |
When a numeric is compared to a literal < 2^31 - 1 it works well, but compared to a greater literal, it is casted to double precision. Why? How can I correct this without explicit cast? db=> \d tipos Table "tipos" Column | Type | Modifiers -----------+---------+----------- _numeric_ | numeric | _decimal_ | numeric | db=> select * from tipos where _numeric_ <= 2147483648; ERROR: Unable to identify an operator '<=' for types 'numeric' and 'double precision' You will have to retype this query using an explicit cast db=> select * from tipos where _numeric_ <= 2147483647; _numeric_ | _decimal_ -----------+----------- 10 | 20 (1 row)
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера