NUMERIC type conversions leave much to be desired

Поиск
Список
Период
Сортировка
От Tom Lane
Тема NUMERIC type conversions leave much to be desired
Дата
Msg-id 17681.926115287@sss.pgh.pa.us
обсуждение исходный текст
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] pg_dump problem?
Следующее
От: Tom Lane
Дата:
Сообщение: pg_dump doesn't dump NUMERIC precision info