Silent truncation of numeric values.

Поиск
Список
Период
Сортировка
От Rajesh Kumar Mallah
Тема Silent truncation of numeric values.
Дата
Msg-id 3FBF6851.8010708@trade-india.com
обсуждение исходный текст
Ответы Re: Silent truncation of numeric values.  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general

Hi,

How come numeric(10,2) accepting value 10.011 and truncating the .001
part ? Shudnt' it be complaining , i am not sure.


Regds
Mallah.


tradein_clients=# CREATE TABLE t_a ( a numeric (10,2) );
CREATE TABLE
tradein_clients=#
tradein_clients=#
tradein_clients=# \d t_a
         Table "public.t_a"
 Column |     Type      | Modifiers
--------+---------------+-----------
 a      | numeric(10,2) |

tradein_clients=# INSERT INTO t_a values(10.01);
INSERT 50817524 1
tradein_clients=# INSERT INTO t_a values(10.011);
INSERT 50817525 1
tradein_clients=#
tradein_clients=#
tradein_clients=# SELECT * from t_a;
   a
-------
 10.01
 10.01
(2 rows)

tradein_clients=#

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

Предыдущее
От: "Markus Seibold"
Дата:
Сообщение: Open source data modeling tools for PostgreSQL
Следующее
От: "Carmen Wai"
Дата:
Сообщение: Invalid page header in block xxxx