• MangoPenguin@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    14 days ago

    Does anyone know why postgresql is so broken when it comes to upgrades? Why it doesn’t do an in-place upgrade of the DB automatically when starting the new version?

    I’ve had enough problems with postgresql that I basically avoid anything using it unless I have no other options.

    • Domi@lemmy.secnd.me
      link
      fedilink
      English
      arrow-up
      3
      ·
      13 days ago

      That’s the thing I don’t like about Postgres either. The performance is significantly better than with MariaDB but Postgres is such a pain for non-enterprise use.

      Same with crash recovery, Postgres just can’t recover if the WAL is corrupted. MariaDB will happily fix itself but Postgres will just sit there and wait until somebody babysits it.

      So you better spin up a second Postgres container, run pg_resetwal, restart the database and terminate any open transactions manually with a 2 page query you hopefully wrote down. Might reindex all tables as well to be sure.

      I have a separate “postgres unfuck” script by now.

    • I like PSQL far more than Maria DB, but it is the most stupid software for upgrades. It is the reason that, whenever I can’t use SQLite, I use a NoSQL DB like Mongo - any single executable NoSQL that contains the entire DB to a single directory seems to be the common factor. Sometimes you might hit an API change, but I think the number of times I’ve had a production application break because of a NoSQL DB server software upgrade is still at 0.

      • MangoPenguin@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        3
        ·
        14 days ago

        MongoDB does have that annoying quirk where it creates several huge files even with a small amount of data in the DB itself. But at least it can be upgraded.

        SQLite is really the only one I’ve used that doesn’t bother me in some way.

        • Agreed, SQLite 💗. It does have limitations when you need to scale with remote connections and concurrency; then you have to start bringing in layers, and it’s really not designed for that. For those jobs, it’s just better IMO to reach to something designed for that use case to begin with.