Leaving MySQL
Having used both MySQL and PostgreSQL enough to have been annoyed by features of both of them and fall into a bunch of their traps, I feel inclined to point out a few ways in which MySQL is better, most of which relate to the initial learning curve.<p>1. MySQL has the better CLI tool. psql is full of minor annoyances, like its cryptic and unmemorable backslash commands like \d for schema inspection, or having a pager turned on by default for query results that are more than one screen length.<p>2. Postgres has a deeply unintuitive concept of &quot;USER&quot;s and &quot;ROLE&quot;s where actually those are the same thing, and commands like CREATE USER and CREATE ROLE are thus basically synonymous (albeit with slight differences in default values). Worse, lots of the docs pages relating to specific commands don&#x27;t highlight this fact at all. A majority of web devs I&#x27;ve talked to about Postgres have at some point complained about how they don&#x27;t understand the permissions system or how ROLEs work.<p>3. While MySQL enforces that a foreign key from column A -&gt; column B requires an index on both A and B, Postgres only requires a foreign key on column B. Maybe this freedom is nice if you know what you&#x27;re doing, but it&#x27;s a major footgun otherwise, since it means that deleting or updating rows in B has a time cost that scales linearly with the number of rows in the table A belongs to.<p>4. MySQL has a handy ON UPDATE current_timestamp shorthand for creating updated_at timestamp columns, which Postgres lacks, requiring you to use a trigger to implement such a column or move the logic to your application layer.<p>5. MySQL&#x27;s &quot;online DDL&quot; features allow making lots of kinds of schema changes without ever holding a lock on the table being updated. In Postgres, by contrast, <i>any</i> schema change, even adding an index with the CONCURRENTLY option, needs to at least momentarily hold a totally exclusive lock that blocks all writes <i>and reads</i> on the table. Worse, as soon as an ALTER TABLE statement starts <i>waiting</i> for that lock, it blocks all new reads and writes against the table. This makes all schema changes in Postgres much more dangerous to the naive; even one that&#x27;s theoretically able to happen concurrently with queries will hang your application if there&#x27;s already a long-running query going against the table to be modified. It also means that at scale you need to roll a bunch of your own tooling to apply schema migrations safely, where you run them from a connection with a very short lock_timeout and wrap them in some code that retries on failure to acquire the lock. I don&#x27;t remember any of this crap being necessary in MySQL.<p>Maybe Postgres is still better; in particular, maybe it&#x27;s more performant in a way that outweighs all these nuisances. I don&#x27;t really know because I&#x27;ve never done any head-to-head comparison to see how the performance of the two would differ in a given scenario, and so the performance differences aren&#x27;t something I&#x27;ve had a chance to witness as an ordinary dev using both databases. But I just want to make clear that there absolutely <i>is</i> another side to the story!