Numeric field quirk - Mailing list pgsql-hackers

From Matthew Hagerty
Subject Numeric field quirk
Date
Msg-id 4.3.2.7.2.20001004233453.00c69f00@pop3.venux.net
Whole thread Raw
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Installation layout is still hazardous for shared prefixes
Next
From: Matthew Hagerty
Date:
Subject: Numeric field quirk [Again]