numeric cast oddity

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема numeric cast oddity
Дата
Msg-id 4B17813C.3040505@compulab.co.il
обсуждение исходный текст
Ответы Re: numeric cast oddity  (Thom Brown <thombrown@gmail.com>)
Re: numeric cast oddity  (Thom Brown <thombrown@gmail.com>)
Re: numeric cast oddity  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
When I cast an integer to numeric using :: notation it ignores the scale
and precision that I specify, but when I use the cast function it uses
the scale and precision that I specify.

Sim

select version();
"PostgreSQL 8.3.5 on i586-pc-linux-gnu, compiled by GCC
i586-pc-linux-gnu-gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.1)"

select -1::numeric(20,4)
?column?
numeric
------------
-1.0000

select cast(-1 as numeric(20,4))
numeric
numeric(20,4)
-------------------
-1.0000


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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: How to auto-increment?
Следующее
От: Thom Brown
Дата:
Сообщение: Re: numeric cast oddity