Numeric field quirk

Started by Matthew Hagertyover 25 years ago1 messages
#1Matthew Hagerty
matthew@venux.net

Greetings,

I'm not sure if this is a bug, but I thought someone might like to know
about it. If you create a numeric field with the precision and scale set
the same, you can't insert anything into the field... pg-7.0.2 on
FreeBSD-4.0-Rel.

Matthew

equinox=# create table test2 ( d numeric(8,2) );
CREATE
equinox=# insert into test2 values ('08.00');
INSERT 167730 1
equinox=# select * from test2;
d
------
8.00
(1 row)

equinox=# create table test2 ( d numeric(3,3) );
CREATE
equinox=# insert into test2 values ('8');
ERROR: overflow on numeric ABS(value) >= 10^0 for field with precision 3
scale 3
equinox=# drop table test2;
DROP
equinox=# create table test2 ( d numeric(4,4) );
CREATE
equinox=# insert into test2 values ('8');
ERROR: overflow on numeric ABS(value) >= 10^0 for field with precision 4
scale 4

equinox=# create table test2 ( d numeric(3,2) );
CREATE
equinox=# insert into test2 values ('8');
INSERT 167742 1