From: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart) |
Cc: | jwieck(at)debis(dot)com, hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] Numeric type |
Date: | 1999-01-06 02:33:28 |
Message-ID: | 199901060233.VAA20326@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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));
CREATE
test=> insert into n1 values ('1.23456', '1.23456');
INSERT 18602 1
test=> insert into n1 values ('12345.23456', '1.23456');
INSERT 18603 1
test=> select * from n1;
n| d
-----------+-------
1.23456|1.23456
12345.23456|1.23456
(2 rows)
--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Vadim Mikheev | 1999-01-06 03:47:47 | Re: [HACKERS] FOR SHARE LOCK clause ? |
Previous Message | Thomas G. Lockhart | 1999-01-06 02:29:15 | Numeric type |