If Postgres was that much better than MySQL then you would expect to see exact reasons on why to pick it. Every comment so far has not listed any reason.
Ok, here's one: When you give MySQL invalid data, its standard behavior is to just silently store garbage in your database in many cases where PostgreSQL would've told you that your data is invalid. MySQL's handling of unicode has also been terrible historically, with way too many foot guns, but I don't know if that may be better with recent versions. People aren't providing strong reasons because the question wasn't…
Ask HN: It's 2023, how do you choose between MySQL and Postgres?
31–40 of 366 posts
Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#32Earlier quoted context omitted.
SQLite is great for its scope - but not in the same class as a full-fledged RDBMS.
Can you give a specific example of what you are missing when using SQLite?
Basically, AFAIK, SQLite becomes problematic once you need more than one computer to handle requests.
Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#33I would say go with what you know and are most comfortable with. You are more likely to get the better outcome.
Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#34Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#35By choosing SQLite. No server process and a single file per DB which I can put wherever I like.
I like SQLite. But I really wish its default behavior wasn't to simply allow garbage data into the database. If I have an int column, don't let me accidentally store a string.
"In a CREATE TABLE statement, if the "STRICT" table-option keyword is added to the end, after the closing ")", then strict typing rules apply to that table. ... The STRICT keyword at the end of a CREATE TABLE statement is only recognized by SQLite version 3.37.0 (2021-11-27) and later.
sqlite> create table x (a int);
sqlite> insert into x values ('hello');
sqlite> select * from x;
hello
sqlite> drop table x;
sqlite> create table x (a int) strict;
sqlite> insert into x values ('hello');
Runtime error: cannot store TEXT value in INT column x.a (19)Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#36also, I assume you mean MariaDB as MySQL is owned by Oracle and I would greatly implore anyone and everyone to avoid Oracle as if it has herpes.
There are a lot of historic problems with MySQL accepting invalid data, committing data even when there are constraint issues, and having very poor transactional isolation, I am not sure if these have improved.
Truthfully, the only benefits you gain from using MariaDB or MySQL are:
* Memory tables
* Having inconsistent replicas (which can be useful when you want your downstream to have less data than your upstream and you know it won’t get updated.)
Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#37If Postgres was that much better than MySQL then you would expect to see exact reasons on why to pick it. Every comment so far has not listed any reason.
Ok, here's one: When you give MySQL invalid data, its standard behavior is to just silently store garbage in your database in many cases where PostgreSQL would've told you that your data is invalid. MySQL's handling of unicode has also been terrible historically, with way too many foot guns, but I don't know if that may be better with recent versions. People aren't providing strong reasons because the question wasn't…
Unicode generally "just works" if the charset in use is utf8mb4. As of MySQL 8.0, this is the default.
Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#38Use Postgres if you need some of the quite-good extensions, most notably PostGIS, or if you just want things to work; most documentation will be postgres flavored. Postgres gets more love from web-developers, and it shows.
Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#39Re: Ask HN: It's 2023, how do you choose between MySQL and Postgres?
#40If Postgres was that much better than MySQL then you would expect to see exact reasons on why to pick it. Every comment so far has not listed any reason.