On 12/08/08 13:56, Petri Laihonen wrote:Is there an equivalent post for postgres?
Ron,
you asked about which wiki I found the comparison....
It was this: http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL
And more specifically in my case:
MySQL supports INSERT IGNORE and REPLACE statements which inserts if a row exists and does nothing otherwise or replaces the current row, respectively.
<Shakes my head in disgust.>
PostgreSQL supports neither of these statements and suggests using stored procedures to get around the lack of these statements. However, there are major shortcomings:
There was some other insert method in mysql addition to the above, but I do not remember it now. But the functionality was such that the row gets updated if it exists, otherwise inserted.
At the worst times, MySQL makes things too sloppily easy for the programmer, and then silents destroys or mangles data.
Three examples from a 10-day old post to ArsTechnica:
http://episteme.arstechnica.com/eve/forums/a/tpc/f/6330927813/m/377006385931
mysql> create table test (id int auto_increment not null,
primary key (id)) engine = InnoDB;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into test values (0);
Query OK, 1 row affected (0.00 sec)
mysql> select * from test;
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.00 sec)
Illegal DATETIME, DATE, or TIMESTAMP values are converted to the “zero” value of the appropriate type ('0000-00-00 00:00:00' or '0000-00-00');
If ALTER TABLE for an InnoDB table results in changes to column values (for example, because a column is truncated), InnoDB's FOREIGN KEY constraint checks do not notice possible violations caused by changing the values;
This archive was generated by hypermail 2.2.0 : 12/19/08 EST