|^ Feature | MySQL 3.x | MySQL 4.0.x | MySQL 4.1.x | PostgreSQL
| SubSelects? | No | Some | Yes | Yes
| Views | No | No | No | Yes
| Foreign Key relationships | No | Yes | Yes | Yes
| Foreign Key constraints | No | No | No | Yes
| Triggers | No | No | No | Yes
| Indexing on non trivial types | No | No | No | Yes
| Sequences | Some1? | Some1? | Some1? | Yes
| Transactions | No | Yes | Yes | Yes
| OO (Inheritance of tables) | No | No | No | Yes
| Async Notifications | No | No | No | Yes
| Constraints | No | No | No | Yes
| SELECT INTO | No | Yes2? | Yes2? | Yes
| Stored Procedures | No | No | No | Yes
| Row level locking | Yes3? | Yes3? | Yes3? | Yes
| Table level locking | Yes | Yes | Yes | Yes
| Multiversion Concurrency Control | No | No | No | Yes
1? Only auto_increment is supported
2? But it's spelled INSERT INTO ... SELECT
3? Only with InnoDB tables
MySQL's big advantage is that it's stupidly simple. If you don't know much about SQL, you can get in and use MySQL and some of the great tools it has (like phpMyAdmin) to do pretty much what you want. These days however there are plenty of easy to use admin tools for PostgreSQL including psql, pgAccess, pgAdmin, phpPgAdmin, Tora.
MySQL's big disadvantage is that it's stupidly simple. If you have learnt about SQL, you find out that in MySQL it is very hard to do complicated things, and if you do try and do complicated things, it bogs down and goes very slow. People may scoff that features such as "views" and "subselects" are "syntactic sugar" but they seriously improve the maintainability of your database, and when combined with well thought out constraints you can trust your data to be correct.
MySQL has some nice features like the ability to modify tables schema easily (PostgreSQL won't let you add a new NOT NULL row in a single step for example), and doesn't require the regular maintenance that PostgreSQL does (you have to regularly VACUUM tables on PostgreSQL if they have a high modification rate), but MySQL is let down by the complete lack of advanced features that you end up needing.
I hope that I am being consistent with proper usage of this Wiki. I have read many postings saying that postgres was slow and is getting faster and mysql is basic but is getting more sophisticated features.
Several years ago I used a postgres database and became quite familar and comfortable with it. Later I switched to MySQL because at the time postgres had a limit of 8k per row and I want to store free text in HTML format. I also lost my linux server and mysql would run quite well on windows.
I stayed with MySQL because I could add free text index to the text fields. When postgres 8.0 came out for windows I thought I would switch back to postgres and try their Tsearch2 index, because I still missed lots of things about Postgres. During the switch I found still postgres familiar and I loved the stored procedures. Sadly however I found postgres incredibly slow and my users refused to accept the postgres text indexing as it way too slow. The interface with proper boolean structures and stemming was much nicer on postgres than mysql. PgAdmin? is a very nice tool.
With some regret I am going back to MySQL, mainly due to speed. For instance I have a fully index table with about 250,000 rows with full text that I need to create "foreign keys" on another table. Updating the foreign key from another table takes maybe 10 minutes on postgres and less than a minute on mysql. (These are not "real" foreing keys because I think the triggering mechanism would slow updates even more. I tried dropping indexs and it didnt make much diffference. Creating a new table and re-indexing it was faster but this is clumsy. Why not just go back to mysql.
4 pages link to PostgresVsMysql:
lib/main.php:944: Notice: PageInfo: Cannot find action page