Unofficial Hacker News companion — get notified on comment replies, and more.

What Changes When You Upgrade from PostgreSQL 18 to 19 (opens external site)

137 points by rgoomar 5 days ago | rishigoomar.com | 76 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (12)

  1. There is no universe where a database auto- updating across major versions is a sane default. If you want a "postgres-yolo" container, you could build it on top of the upstream image and use cron/github action/etc to automate rebuilds.
    Replies (4)
    1. Supporting people who think "postgres-yolo" should be a thing would be a masochistic self-own. Perpetual backwards compatibility is not a reasonable addition to all the other constraints that database development must satisfy.
      Replies (1)
      1. > Perpetual backwards compatibility is not a reasonable addition to all the other constraints that database development must satisfy.

        sqlite3 has been backwards compatible since its release in 2004.

        Replies (2)
        1. That's comparing apples and oranges. Only a vanishingly small number of SQLite instances are administered by DBAs, therefore the file format has to remain stable. Also, Sqlite3 has no ambition to introduce a massive number of new features, to scale to the skys (though it is surprisingly good in that regard), and prioritizes stability and simplicity.
        2. SQLite also lives in the same operating system process as the application. It has many important use-cases.

          Postgres and other databases like it are purposefully outside of the lifetime of a single executable call. They can run for the entire lifetime of a business.

          A third use-case are Excel spreadsheets.

    2. Let’s call it fake SMR as a service.
    3. PostgreSQL (over the wire) is backwards compatible for at least a few versions, so it should be "pretty safe" for a lot (most?) situations.
      Replies (1)
      1. The file format is not safe. Thus the major version.
        Replies (1)
        1. There's literally a utility, pg_upgrade, that comes with PostgreSQL for doing upgrades:

          https://www.postgresql.org/docs/current/pgupgrade.html

          Are you saying that can go wrong?

          Replies (1)
          1. Yes, and this is a tool you need to run yourself when migrating between major versions.

            The discussion was started by someone YOLOing their service by using something like "postgres:latest" docker image (I assume), and complaining that it breaks when major version changes.

            Replies (1)
            1. The times when pgautoupgrade goes wrong are rare, and they've mostly turned out to be ~99% upgrade scripting related, the containers being used in an unusual way, or unusual PostgreSQL extensions that need special treatment which we haven't yet taken into account.

              ie Bitnami containers turned out to do weird things, and it took a while to get the pgautoupgrade scripting to play well with them.

              The PostgreSQL 17 → 18 on disk layout change by Docker Inc's "postgres" team also caused significant problems, as they were warned it would. But they did it anyway. :(

              The pg_upgrade utility which it uses, which comes with PostgreSQL itself, has been very solid.

    4. > There is no universe where a database auto- updating across major versions is a sane default.

      And yet, whether it is due to work from distro maintainers or due to slower pace of development from Oracle, I just have never had a serious upgrade problem on MySQL deployments. I am sure they exist, but for a casual user MySQL upgrades seem to break never and Postgres breaks every update. Guess which one I choose?