This whole MySQL versus PGSQL thing

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: This whole MySQL versus PGSQL thing
Date: 2003-07-15 20:56:31
Message-ID: Pine.LNX.4.33.0307151453210.28275-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.
:-)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-07-15 20:58:35 Re: [GENERAL] INSTEAD rule bug?
Previous Message Alvaro Herrera 2003-07-15 20:52:21 Re: selects during vacuum