News for hackers. Stuff that matters.
Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by corty on Saturday February 27, 2021 @06:05AM (#26284041)
PostgreSQL: "your date 2020-02-31 isn't a date, fix that"

MySQL: "2020-02-31? Whatever man, I'll just enter something..."

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by consp on Saturday February 27, 2021 @06:18AM (#26284101)
Considering the US uses a weird date format, I definitely prefer the former in combination with input sanitation forcing you to thing about your actions before assuming the database will fix it for you.
Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by corty on Saturday February 27, 2021 @06:32AM (#26284164)
Agreed. As with strong typing in programming languages, I do prefer a database to be strict in rejecting invalid inputs. MySQL does two bad things here: It accepts an invalid input plus it interprets it creatively, producing something the user most probably didn't intend. In that respect, MySQL is almost as bad as Excel creatively "interpreting" dates.

Another example of a database doing improper things would be Oracle mixing up the empty string with NULL. In Oracle, both are the same...

MySQL has a few more of those gotchas, e.g. regarding broken charsets (UTF-8 isn't 'utf8', it is 'utf8mb4', 'utf8' is an alias for 'utf8mb3' which is a broken subset). I wouldn't use MySQL for any data that was important to get back consistently. However, since Uber seems to be using some schemaless "we don't care"-layer anyways, that point is moot for the original article.

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by vinger on Saturday February 27, 2021 @09:33AM (#26285072)
utf8mb3 isn't a broken subset. It includes characters in the basic multilingual plane which is fine for 99% of cases.

uft8mb4 uses more bytes than necessary for most. You get 255 varchar limits with uft8mb3, I think you only get 192 characters with uft8mb4.

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by Alexendoo on Saturday February 27, 2021 @10:00AM (#26285240)
uft8mb4 does not use more bytes than utf8mb3, for anything representable by utf8mb3 the size in uft8mb4 is identical. Anything that would be 4 bytes in uft8mb4 is not able to be stored in utf8mb3

utf8mb3 is definitely a broken subset, it's deprecated at the very least

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by bbarnett on Saturday February 27, 2021 @08:18AM (#26284661)
https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sql-mo...

Much of your MySQL complaint is not a MySQL issue, but a config issue.

And yes, powerful config options are good, not bad.

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by BitPirate on Saturday February 27, 2021 @09:55AM (#26285210)
One can still complain about mysqls dumb defaults.

https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.ht...

"Hey, let's just not act transactional on a timeout by default"

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by evanelias on Saturday February 27, 2021 @10:54AM (#26285604)
That default is sensible. You're making it sound like this setting applies to all "timeouts" regardless of type. That is not the case.

This setting applies to lock-wait timeouts. The default value allows applications to decide on the correct course of action: either re-try just the statement that timed out (without having to re-do the previous parts of the transaction), or rollback the transaction.

The application still receives an error on the timeout regardless of this setting. The database doesn't automatically commit the previous statements in the transaction regardless of this setting.

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by rubyist5eva on Saturday February 27, 2021 @09:45AM (#26285151)
The mysql behavior terrifies me because eventually you're going to end up with something you didn't expect and it's going to be a pain in the butt to track it down.
Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by evanelias on Saturday February 27, 2021 @10:51AM (#26285573)
MySQL's default settings reject invalid dates for over 5 years now, since MySQL 5.7.

How long are people going to keep repeating this complaint? Literally every version of MySQL and MariaDB that allows invalid dates by default (MySQL 5.6 and older, MariaDB 10.1 and older) has reached end-of-life for upstream support from the vendor!

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by isoprophlex on Saturday February 27, 2021 @06:29AM (#26284156)
That doesn't exactly sell me on MySQL, sounds like a recipe for disaster
Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by corty on Saturday February 27, 2021 @06:34AM (#26284178)
There is more, however not everything is still valid or valid for every table type in MySQL: https://sql-info.de/mysql/gotchas.html
Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by evanelias on Saturday February 27, 2021 @11:08AM (#26285698)
"This page deals with issues related to MySQL 4.1 and earlier, not 5.0"

MySQL 5.0 came out over 15 years ago.

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by chris_wot on Saturday February 27, 2021 @08:21AM (#26284680)
That's not decreasing complexity, that's just shifting it out of the database layer.

See https://news.ycombinator.com/item?id=26272084

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by martimarkov on Saturday February 27, 2021 @07:32AM (#26284428)
Oh yeah old complication of sanitising input...

It’s like asking you for an int and you entering 2.358 and saying that’s just simple.

Re:Why Uber Engineering Switched from Postgres to MySQL (2016) by exikyut on Saturday February 27, 2021 @10:23AM (#26285382)
Ooh, sounds like PHP 5!