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