Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you are using activerecord it really doesn't matter. You have a "the database is stupid and shouldn't do anything so we'll write a buggy ad-hoc database in ruby on top of it" layer on top of the database, which pretty much precludes using the database effectively. If you want to actually use the database, here's some reasons postgresql is a better choice than mysql:

strict treatment of invalid data

mysql views with aggregates DISTINCT GROUP BY HAVING LIMIT UNION or UNION ALL Subquery in the select list are too slow to be useable

mysql has no check constraints

mysql has no conditional/expression indexes

mysql only has broken geospatial support

mysql has no full text indexing on innodb tables

postgresql has an extensible type system (and booleans!)

postgresql has sequences

postgresql has table inheritance

mysql triggers don't fire on cascaded actions or replication

mysql has no window functions

mysql can't set default values to be a function (there is a workaround for only dates, and only one per table)

postgresql has schemas

postgresql has a transactional DDL (you can roll back an alter table)

rollbacks in mysql are incredibly slow, and if you cancel one it can corrupt the table

mysql limit can't accept variables!?

mysql subqueries are limited: can't modify and select from the same table

mysql stored procedures can't have default args

mysql functions (and thus triggers) can't use prepare/execute, so no dynamic sql

mysql functions can't be called recursively

mysql triggers can't alter the table they are being called against

mysql stored procedures can't be called from dynamic sql (prepare)

mysql can't log error producing queries

mysql slow query log has a resolution of seconds



>mysql has no full text indexing on innodb tables

it has this in recent versions, but it's shockingly bad at matching.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: