Tekpub: Why Not MySQL?
Why Stack Overflow recommends it
Stack Overflow users link it when comparing MySQL and PostgreSQL, usually to illustrate MySQL's surprising defaults and data-integrity gotchas.
Recommended by 2 people across 2 different months, 2012 to 2013.
What it is
An 11-minute episode from Tekpub's free Hello Postgres series that walks through odd MySQL behaviours, such as lenient handling of NULLs and defaults, and shows how PostgreSQL treats the same cases more strictly. The presenter frames it as an answer to the question of why to choose Postgres over MySQL.
What people said
Recommends Daniel Miladinov · 2012-11 · Stack Overflow · on “Changing defaults”
Since dnumber is the primary key of the department table, it cannot have a null value. So, what will happen if you actually try to insert the following? INSERT INTO department(dname, mgrssn) VALUES ("test", "123456789"); You'd expect the insert to fail with an error. But no, it succeeds, (albeit, with a warning): mysql> INSERT INTO department(dname, mgrssn) VALUES ("test", "123456789"); Query OK, 1 row affected, 1 warning (0.04 sec) What just happened? Well, turns out to be one of MySQL's many gotchas [LINK] , where " NULL is NOT NULL ". Today's MySQL manual says pretty much the same thing [LINK] : If a column definition includes no explicit DEFAULT value, MySQL determines the default value
Recommends Marcelo Tataje · 2013-02 · Stack Overflow · on “MySQL vs PostgreSQL spatial application”
It depends on what you really wanna do, MySQL is user-friendly with all the UI tools it has, now you are able to model and create databases very fast with the mysql workbench. In terms of performance, MySQL is good, but I think Postegres has a better license and even when it has no a lot of tools, it provides the required functionality. You can take a look at this: [LINK] I recommend you this video as well: [this video] Best regards my friend.
Cites Erwin Brandstetter · 2012-11 · Stack Overflow · on “PostgreSQL Error for Select Distinct in Rails”
You query is ambiguous in two ways: ptype is not table-qualified and you did not disclose the table definitions. So the query is ambiguous. More importantly, you want to: ORDER BY programs.rating DESC, program_schedules.start DESC At the same time, however, you instruct PostgreSQL to give you DISTINCT rows from programs . If there are multiple matching rows in program_schedules , how would Postgres know which one to pick for the ORDER BY clause? The first? Last? Earliest, latest, greenest? It's just undefined. Generally, the ORDER BY clause cannot disagree with the DISTINCT clause, that's what the error message tells you. Based on a few assumptions, filling in for missing information, your q
Cites Bacon Bits · 2013-01 · Stack Overflow · on “What's a foreign key for?”
The basic idea of foreign keys, or any referential constraint, is that the database should not allow you to store obviously invalid data . It is a core component of data consistency, one of the ACID rules [LINK] . If your data model says that you can have multiple phone numbers associated with an account, you can define the phone table to require a valid account number. It's therefore impossible to store orphaned phone records because you cannot insert a row in the phone table without a valid account number, and you can't delete an account without first deleting the phone numbers. If the field is birthdate, you might enforce a constraint that the date be prior to tomorrow's date. If the fiel