2 ms·
I never understood why people use MySQL for anything where correctness is important. The auto-truncaction is only one of many nasty surprises. Did you know tha
by vog 11y ago
I never understood why people use MySQL for anything where correctness is important. The auto-truncaction is only one of many nasty surprises.
Did you know that auto-truncation also kicks in if your columns values are small, but you run a CONCAT on them? That was a nasty surprise when a generated a CSV line on DB side, which by bad luck was truncated immediately before a comma, so the result was correst, just the jast few items were missing. And ever looked at the handling of invalid dates? Not to mention what happens if you forgot to specify a column in your GROUP BY clause, but use it in the SELECT part ...
To anyone who is so brave to write their application using that database: Be sure you know all those issues and take care of them in your application. Or make sure you aren't affected by them. Or, switch to a high-quality database!
I switched to PostgreSQL a long time ago and never looked back. These people care about exactness, quality and clean extensibility in all directions, even user-defined index structures are possible (GIN, GIST). The problem that PostgreSQL was slower than MySQL disappeared as soon as MySQL became transaction safe with InnoDB, because it was now a fair comparison as PostgreSQL was transaction safe from the very beginning. Also, the PostgreSQL project management is one of the best I have ever seen, meeting schedules, regular commit fests, quality-driven, honest beta releases, and so on.
- rimantas 11y ago> I never understood why people use MySQL for anything where > correctness is important. They probaly know how to configure it.
- vog 11y agoThis doesn't seem to be any harder than MySQL, it's just a bit different. Also note that PostgreSQL can perform "peer" auth, so you don't have to fiddle with DB passwords unless you really want to access your DB over a network. Install package: apt-get install postgresql-9.4 Become PostgreSQL admin: su - postgres Create a DB user who is allowed to create databases (assuming your app will run as user "someuser"): createuser -d someuser Login as that user: exit su - someuser Create your database: createdb somedb Play with your database: psql somedb CREATE TABLE ...
- gohrt 11y agoIf you are going to the effort to learn all the ways you need to tell MySQL to not corrupt your data, you may as well spend that energy learning PostgreSQL