What quirks have you found in your favorite database? [closed]
Q: Why do we have more than one database?
A: Because they all suck.So which "feature" of your favorite database made you think (or even say) "WTF???"
For example, Oracle doesn't support TIME as a native type. Instead, TIME is folded into DATE, so you mus开发者_运维知识库t chop'n'dice in your queries.
Or "optimizer hints" which Oracle is free to ignore. Since they are implemented as comments in the SQL query, you won't notice when you make a typo in them. Or when Oracle ignores them.
Oracle's treatment of an empty VARCHAR as NULL is high on my list.
MySQL allows one to store invalid dates in the DB, like 00-00-0000. And there are people that are using that too. Infinite joy when you try to use that data in a language that has a proper native DateTime type (like C#).
"What quirks have you found in your favorite database?"
SQL.
But that answer is slightly dishonest, because at the time I discovered SQL in "my favourite database", I did not yet know that it was a quirk, or why.
Don't really care for the fact that Sybase has no FULL OUTER JOIN. You have to LEFT/RIGHT/UNION to get what you want. Yuck.
Oracle's interpretation for "transaction isolation level == SERIALIZABLE" is to throw an exception if something goes wrong. Instead of using locking to prevent other queries from affecting the same rows you are interested in, it simply throws an exception when that happens. So you can restart your (possibly complicated and lengthy) transaction again. And in a busy system it might never complete because other people keep using the DB too. Awesome.
You may be interested in the following:
- MySQL Gotchas
- PostgreSQL Gotchas
精彩评论