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 (20)

  1. I can always tell when a new postgres comes out because one of my docker powered apps just breaks (just a selfhosted one, nothing actually important). The official docker for postgres attempts to do no auto update between versions and you're basically left to go figure it out yourself when `latest` breaks itself. This is by design, apparently.

    I know there's an argument for version pinning, but I don't want to have to handhold random docker containers. It should be automated IMO. It's become a deterrent for me wanting to deploy anything that depends on postgres.

    Replies (6)
    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.

              Continue this thread (1 replies) →

      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?

    2. I'm in same boat. I love Postgres but honestly it's backward incompatability is a non starter for self-hosting.
      Replies (1)
      1. You don’t have to upgrade to a new major version when it comes out, you know?

        Postgres 18 will still get bug fixes and security updates for 4 more years.

    3. Semver in practice is "a land of contrasts", but when exactly is 'latest' the best possible idea for production postgres?

      At that point also go with "ext4" 'latest'. Bonus points for it silently going to ext5 in future.

    4. If you want to YOLO the latest version with automatic upgrade, consider using [1] instead of the default postgres:latest image

      [1]: https://hub.docker.com/r/pgautoupgrade/pgautoupgrade

      Replies (1)
      1. Needs an option that pre-compresses to zero Bytes on rainy Tuesday's in timezones with a something-and-a-half hours offset from UTC during DST and a race condition in a chron job.
    5. Being on 'latest' instead of a fixed version (at least the major number) is crazy but I agree that the official image not being able to upgrade the data is very inconvenient.

      Allowing auto-updating through an env var or something would be appreciated.

    6. IMO there shouldn't be a latest tag, it's a trap