Re: numeric field overflow
От | Scott Marlowe |
---|---|
Тема | Re: numeric field overflow |
Дата | |
Msg-id | dcc563d10910052330g1559eaf6qeb6eb8693edb9ece@mail.gmail.com обсуждение исходный текст |
Ответ на | numeric field overflow (Nurzhan Kirbassov <km.sameboy@gmail.com>) |
Список | pgsql-general |
On Tue, Oct 6, 2009 at 12:20 AM, Nurzhan Kirbassov <km.sameboy@gmail.com> wrote: > Good day. > > I may be misunderstanding the NUMERIC type description in the manual, > so can anyone please help me with this? Description says: > > "The scale of a numeric is the count of decimal digits in the > fractional part, to the right of the decimal point. The precision of a > numeric is the total count of significant digits in the whole number, > that is, the number of digits to both sides of the decimal point. ... > Integers can be considered to have a scale of zero. " > > However, I am not able to insert numbers that have number of digits > equal to the precision and the scale equal to 0. > > F.E.: > > CREATE TABLE test.test > ( > rate numeric(5,1) > ) This declares a numeric of 5 digits, with 1 to the right of the decimal point. > > INSERT INTO test.test VALUES (10000) > > Generates an error: Like it should. however this: CREATE TABLE test.test ( rate numeric(5,0)); INSERT INTO test.test VALUES (10000); INSERT 0 1 Works just fine.
В списке pgsql-general по дате отправления: