Re: [HACKERS] numeric & decimal - Mailing list pgsql-hackers

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] numeric & decimal
Date
Msg-id m10c6EK-000EBgC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
Responses Re: [HACKERS] numeric & decimal
Re: [HACKERS] numeric & decimal
List 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) #

pgsql-hackers by date:

Previous
From: Peter Mount
Date:
Subject: RE: [INTERFACES] JDBC and waiting for commit on a locked table in 6.4.2
Next
From: JP Rosevear
Date:
Subject: Re: [GENERAL] unknown symbol 'lo_unlink'