Comment by paulryanrogers

9 hours ago

Upgrades are hard. There was no replication in the before times. The original block-level replication didn't work among different major versions. Slony was a painful workaround based on triggers that amplified writes.

Newer PostgreSQL versions are better. Yet still not quite as robust or easy as MySQL.

At a certain scale even MySQL upgrades can be painful. At least when you cannot spare more than a few minutes of downtime.

> At least when you cannot spare more than a few minutes of downtime.

I think it boils down to this. We used to constantly be running the obsolete pg version until it became an emergency mostly because upgrading with the tooling available at the time was very painful. Today however, we stay relatively up to date. Once you figure out the data replication, you can almost do blue green deployments on databases with almost no down time.

MySQL vs. PostgreSQL - Jepsen Analyses

https://news.ycombinator.com/item?id=23498781

"PostgreSQL is a widely-known relational database system. We evaluated PostgreSQL using Jepsen’s new transactional isolation checker Elle, and found that transactions executed with serializable isolation on a single PostgreSQL instance were not, in fact, serializable. Under normal operation, transactions could occasionally exhibit G2-item: an anomaly involving a set of transactions which (roughly speaking) mutually fail to observe each other’s writes. In addition, we found frequent instances of G2-item under PostgreSQL “repeatable read”, which is explicitly proscribed by commonly-cited formalizations of repeatable read. As previously reported by Martin Kleppmann, this is due to the fact that PostgreSQL “repeatable read” is actually snapshot isolation. This behavior is allowable due to long-discussed ambiguities in the ANSI SQL standard, but could be surprising for users familiar with the literature. A patch for the bug we found in serializability is scheduled for the next minor release, on August 13th, and the presence of G2-item under repeatable read could be readily addressed through documentation."

"Not as robust as MySQL"? Surely you're joking.

  • They’re not wrong. If you’ve ever spent meaningful time administering both, you’ll know that Postgres takes far more hands-on work to keep it going.

    To be clear, I like both. Postgres has a lot more features, and is far more extensible. But there’s no getting around the fact that its MVCC implementation means that at scale, you have to worry about things that simply do not exist for MySQL: vacuuming, txid wraparound, etc.

    • My experience of both is that MySQL is easier for developers, PostgreSQL is easier for sysads.

      That was true in 2012; dunno if it still applies though.

      4 replies →

    • My experience has been exactly opposite. Ability to do Vacuums is good. MySQL doesn’t free up space taken by deleted rows. The only option to free up the space is to mysqldump the db and load it again. Not practical in most of the situations.

      2 replies →

  • It is hard to live down a reputation ;)

    MySQL was immortalized as the database in every LAMP stack. And just like PHP it improved considerably since then.

    • Also for licensing reasons for a long time there was surviving contingent of MySQL 3.23 in LAMP hosting.

Is slony some sort of language joke? Slon is czech (probably slavic in general) for elephant.

(which may be actually derived from the turkish aslan, for lion, but somehow the animal got mixed up)

  • I think so. The PostgreSQL logo is an elephant, and the community calls him "Slonik", probably derived from the Russian word for elephant. There is also a node.js driver that is called "slonik"

I've always wondered why Postgres is so insanely popular. I mean it has some nice things like very powerful support for a very comprehensive subset of SQL functionality, but most apps don't need all that.

It really feels like early 1990s vintage Unix software. It's clunky and arcane and it's hard to feel confident doing anything complex with it.

  • > I've always wondered why Postgres is so insanely popular.

    In no particular order, my preference for postgres is driven by:

      * Date / time functions that don't suck
      * UTF-8 is really UTF-8
      * 99% of a backup can be done live with nothing more than rsyncing the data directory and the WAL files
      * Really comprehensive documentation
      * LTREE and fuzzy string match extensions
      * Familiarity from using it for years
    

    MySQL/Maria I'm sure is fine, but it's one of hose things where it's just different enough and I haven't encountered a compelling use case for changing my preference.

    • UTF-8 is what made me switch. It’s insane MySQL has something called UTF-8 that isn't really UTF-8, but do have a type UTF8MB4 that actually is correct. This means if you use UFT-8 in MySQL, you can’t use emoji for example.

      12 replies →

    • MySQL does have ON UPDATE for its DATETIME, though; something that Postgres inexplicably still lacks.

  • * transactional DDL

    * comprehensive transaction model using different modes

    * PostGIS and lots of other great extensions

    * supports most of the current SQL standard and is clear on interpretation of edge-cases in the documentation

    * support for writing stored procedures in any major programming language

    * many useful functions regarding dates, sets, ranges, json, xml, ...

    * custom datatypes

    * extremely thought-out and standardized approach to development: if a feature is included it generally works well in interaction with everything else

    * syntax, semantics and performance are all very predictable

    * great documentation

    Regarding MySQL / MariaDB: MySQL optimized for performance first. Until 2010 the standard-storage-engine MyISAM didn't even support transactions.

    PostgreSQL always focused on correctness and stability and then made sure everything performed.

  • What's the alternative? MySQL? No transactional DDL, immediate fail.

    • I worked for a company that migrated from mysql to postgres, but then got big enough they wanted to hire fulltime database experts and ended up migrating back to mysql because it was easier to find talent

      3 replies →

    • It's not just DDL that isn't transactional, there's a whole bunch of other things that aren't. And they break the transactionality silently. It's like an obstical course where bumping into something might be fatal.

      1 reply →

  • > It really feels like early 1990s vintage Unix software. It's clunky and arcane and it's hard to feel confident doing anything complex with it.

    How software "feels" is subjective. Can you be more specific?

    • It requires a ton of somewhat arcane maintenance at scale. Vacuum shenanigans, Index fragmentation requiring manual reindexing, Txid wraparounds. I like Postgres but it’s definitely way more work to maintain a large instance than mysql. MySQL just kinda works

  • > I've always wondered why Postgres is so insanely popular.

    Just another anecdote: MySQL lost data for me (2004). I spent some time evaluating the projects and Postgres’ development process seemed much more mature — methodical, careful, and focused on correctness. Boring, which I loved.

    I didn’t need whatever perf advantage MySQL had so I switched to Postgres and never looked back. And then the Oracle drama and Monty’s behavior around it — not saying he was wrong or right, but it was the opposite of boring — just reinforced my decision.

    I like to play with new tech in various spots of the stack, but for filesystems and databases I go boring all the way.

  • > I've always wondered why Postgres is so insanely popular

    Real answer: no licensing cost

  • Because it's not tainted and cursed by Oracle, like MySQL (and Oracle).

    • That's what MariaDB is for, right? I'm surprised to hear people recommend the Oracle fork of MySQL (still called MySQL because they own the trademark) rather than the original project (now called MariaDB)