Re: [HACKERS] numeric & decimal
Jan Wieck <jwieck@debis.com>
From: jwieck@debis.com (Jan Wieck)
To: jose@sferacarta.com ( José Soares)
Cc: pgsql-hackers@postgreSQL.org
Date: 1999-04-27T11:40:47Z
Lists: pgsql-hackers
> Hi all,
>
> I'm trying numeric & decimal types in v6.5beta1 and I have two questions
> about it.
>
> [...]
>
> Second question:
> Why PostgreSQL allows to insert 14 digits into a numeric(5,1) ?
>
> create table test(
> n numeric(10,3),
> d decimal(5,1)
> );
For some reason (dunno why) the parser ignores the precision
for DECIMAL. atttypmod is set hardcoded to -1. So the above
is identical to a
CREATE TABLE test (n numeric(10,3), d decimal);
I'll test what happens if I enable it in gram.y and if it
doesn't break any regression commit the changes.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck@debis.com (Jan Wieck) #