Where the open source database community meets: Use code PERCONA75 and secure your spot for Percona Live.  Register

Always Verify Examples When Comparing DB Products (PostgreSQL and MySQL)

September 7, 2017
Author
Manjot Singh
Share this Post:

PostgreSQL and MySQLIn this blog post, I’ll look at a comparison of PostgreSQL and MySQL.

I came across a post from Hans-Juergen Schoenig, a Postgres consultant at Cybertec. In it, he dismissed MySQL and showed Postgres as better. While his post ignores most of the reasons why MySQL is better, I will focus on where his post is less than accurate. Testing for MySQL was done with Percona Server 5.7, defaults.

Mr. Schoenig complains that MySQL changes data types automatically. He claims inserting 1234.5678 into a numeric(4, 2) column on Postgres produces an error, and that MySQL just rounds the number to fit. In my testing I found this to be a false claim:

His next claim is that MySQL allows updating a key column to NULL and silently changes it to 0. This is also false:

In the original post, we never see the warnings and so don’t have the full details of his environment. Since he didn’t specify which version he was testing on, I will point out that MySQL 5.7 does a far better job out-of-the-box handling your data than 5.6 does, and SQL Mode has existed in MySQL for ages. Any user could set it to STRICT_ALL|TRANS_TABLES and get the behavior that is now default in 5.7.

The author is also focusing on a narrow issue, using it to say Postgres is better. I feel this is misleading. I could point out factors in MySQL that are better than in Postgres as well.

This is another case of “don’t necessarily take our word for it”. A simple test of what you see on a blog can help you understand how things work in your environment and why.

0 0 votes
Article Rating
Subscribe
Notify of
guest

5 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Jouni Järvinen
8 years ago

Yep, that guy is an idiot, he’s incompetent to say anything.

David
8 years ago

Hi Manjot Singh,

Thanks for the post.

The post of Mr. Schoenig is the prove that we must filter all our reads. I believe in the “free speech” but some people just use it in the wrong way.

Neo
Neo
8 years ago

Maybe everyone should read why Uber ditched Postgres and moved to MySQL

https://eng.uber.com/mysql-migration/

Jouni Järvinen
8 years ago
Reply to  Neo

Wow.

Guillaume Lefranc
8 years ago

Most of the complaints about MySQL from the PostgreSQL world are based on MySQL 5.0 or worse.
I also once heard “MySQL doesn’t have FULL GROUP BY”. Come on guys, ONLY_FULL_GROUP_BY has existed as a SQL_MODE since MySQL 5.0…

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved