An unofficial, read-only Hacker News reader.

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

104 points by rgoomar 2 days ago | rishigoomar.com | 27 comments on HN

View full thread · View on Hacker News

Comment thread (10)

  1. I am surprised that "an already-open transaction that reads events for the first time after the swap can see an empty table" is considered acceptable.

    I am not a Postgres user, and I appreciate that production databases are complicated beasts. Do people who use Postgres for production think this sounds fine?

    Replies (2)
    1. IIRC it depends upon transaction isolation level, and every mode has its trade-offs
      Replies (1)
      1. No, this specific deficiency applies in all isolation modes, and is therefore probably the main reason why that behaviour is not the default.
    2. Try storing datetimeoffset (ie datetime with time zone) in Postgres. It can’t.

      Also suppose you have a lastname and want to have case-insensitive search over it (prefix and equal).

      In MS SQL you just add an index. By the way, there is only one type to choose from (ignoring clustered or multicolumn) — it just works.

      In Postgres you needed to jump through effing hoops just for that until like 1-2 years ago when they finally added case-insensitive collation with prefix search support.

      —

      How people ignored such basic stuff for any CRUD app for years is beyond me.

      Replies (2)
      1. Conversely, MS SQL doesn’t allow BRIN indexes for clustered row-store tables despite already having the code in the database engine for it!

        Every database engine has bizarre limitations that make no sense to me.

        I’ve noticed that a few other disgruntled DBAs have started fixing these issues up by throwing tokens at Postgres.

      2. timestamptz (with time zone) stores the times without time zone (in UTC), on the rationale that 'with time zone' means each read/write of that column will have a user supplied time zone..
        Replies (1)
        1. Timestampz discards the timezone and converts to utc, meaning it is a destructible operation — you cannot bring back the original.

          This may be important in many cases: for example antifraud where you want to store also what was literally on the user’s clock (including timezone) and show it later in reports and what have you

          Replies (2)
          1. I agree that the MSSQL timezoneoffset approach is the best.

            However the Postgres (and others) work-around is simply to add a LocalTimeZone field where necessary.

            Yeah, it's not as convenient, but it's a simple, effective, work-around.

            For me, this isn't the killer-app distinction that suggests choosing MSSQL over Postgres.

            Replies (1)
            1. > I agree that the MSSQL timezoneoffset approach is the best.

              It is not. A static offset is largely equivalent to a utc timestamp, and thus useless for any consideration of future event.

              If you’re concerned about the limited historical and auditing value, it’s not exactly difficult to just tack that information on in a second column, or create a custom type which you can even call datetimeoffset but hanging the entire thing on that edge case is nonsense.

              Hell, if you’re concerned about auditing events or fraud control you want a ton more data than just a timezone offset advertised by the client, and storing an entire timestamp just to keep that datum around is an unnecessary waste.

          2. This kind of audit trail sounds like a "store a string" nail or hammer.