Re: [HACKERS] Numeric type

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Numeric type
Дата
Msg-id 199901060233.VAA20326@candle.pha.pa.us
обсуждение исходный текст
Ответ на Numeric type  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Список pgsql-hackers
> OK, I give up :) How do I use the numeric type?
> 
> postgres=> create table n1 (n numeric(10,5), d decimal(10,5));
> CREATE
> postgres=> insert into n1 values ('1.23456', '1.23456');
> ERROR:  overflow on numeric
>         ABS(value) >= 10^0 for field with precision 2087 scale 31828
> postgres=> insert into n1 values ('12345.23456', '1.23456');
> ERROR:  overflow on numeric
>         ABS(value) >= 10^4 for field with precision 2087 scale 50860
> 

Works here.  Don't you hate when that happens:test=> create table n1 (n numeric(10,5), d decimal(10,5));CREATEtest=>
insertinto n1 values ('1.23456', '1.23456');INSERT 18602 1test=> insert into n1 values ('12345.23456',
'1.23456');INSERT18603 1test=> select * from n1;          n|      d-----------+-------
1.23456|1.2345612345.23456|1.23456(2rows)
 


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Numeric type
Следующее
От: Vadim Mikheev
Дата:
Сообщение: Re: [HACKERS] FOR SHARE LOCK clause ?