NUMERIC type conversions leave much to be desired

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: NUMERIC type conversions leave much to be desired
Date: 1999-05-07 22:14:47
Message-ID: 17681.926115287@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

With fairly current sources:

regression=> create table dnum (f1 numeric(10,2));
CREATE
regression=> insert into dnum values ('12.34');
ERROR: overflow on numeric ABS(value) >= 10^1 for field with precision 31491 scale 52068
regression=> insert into dnum1 values ('12.34'::numeric);
ERROR: overflow on numeric ABS(value) >= 10^1 for field with precision 31491 scale 52132
regression=> insert into dnum1 values (12.34::numeric);
ERROR: parser_typecast: cannot cast this expression to type 'numeric'
regression=> insert into dnum1 values (12.34);
INSERT 950499 1

I've not put in Thomas' proposed change for handling out-of-range
constants; I don't think it'd change any of these cases anyway.

BTW, why is there no regression test for NUMERIC?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-05-07 22:30:39 pg_dump doesn't dump NUMERIC precision info
Previous Message Tom Lane 1999-05-07 21:16:58 Re: [HACKERS] pg_dump problem?