This whole MySQL versus PGSQL thing - Mailing list pgsql-general

From scott.marlowe
Subject This whole MySQL versus PGSQL thing
Date
Msg-id Pine.LNX.4.33.0307151453210.28275-100000@css120.ihs.com
Whole thread Raw
List pgsql-general
OK, so I thought I'd do some more checking.

MySQL is known for just swallowing what you give it and going on without
raising an exception.  numeric is also one of them

SQL script in postgresql:

create table testa (i1 numeric (4,2), i2 numeric(4,2));
insert into testa values (100.23,99.34);
ERROR:  overflow on numeric ABS(value) >= 10^2 for field with precision 4
scale 2


in mysql:

create table testa (i1 numeric (4,2), i2 numeric(4,2));
insert into testa values (100.23,99.34);
Query OK, 1 row affected (0.00 sec)
insert into testa values (10000.23,99.34);
Query OK, 1 row affected (0.00 sec)
insert into testa values (100000.23,99.34);
Query OK, 1 row affected (0.00 sec)

select * from testa;
+--------+-------+
| i1     | i2    |
+--------+-------+
| 100.23 | 99.34 |
| 999.99 | 99.34 |
| 999.99 | 99.34 |
| 999.99 | 99.34 |
+--------+-------+
4 rows in set (0.00 sec)

Hope you weren't basing any accounting systems on this database.
:-)


pgsql-general by date:

Previous
From: "Dann Corbit"
Date:
Subject: Re: Firebird vrs Postgresql
Next
From: Dmitry Tkach
Date:
Subject: Re: [BUGS] INSTEAD rule bug?