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

  1. That's a problem only because your data model doesn't take into account how to make user supplied datetime work. Timestamp and the likes are not for user supplied data, datetime is. And if you are going to deal with it, you should store two dates: what the user said and what the datetime in utc is at the moment of recording. That gives you everything you will ever need: comparison between timezones, offsets regardless of timezones and a coherent user presentation.
    Replies (2)
    1. Dude, you literally have datetimeoffset in ms sql
      Replies (3)
      1. That's not SQL standard. Pg can provide similar functionality with custom types and functions, if it must be a single assignment and output.
        Replies (1)
        1. Like I’ve said with an example of prefix case-insensitive search, some things like ms sql are user-friendly and down to earth problems, and others have excuses "you are holding it wrong".
      2. Congratulations. MSSQL has some good features. Its cost, administrative overhead, and lack of available source make it an unacceptable option for a lot of people. Postgres also has lots of features that MSSQL does not have. Not sure why any of this is relevant in a post about differences in the new PG version.
      3. And? I'm questioning your data model, same problem will happen no matter your database, because now you have to consider DST and comparisons between timezones that are timezone sensitive. Meanwhile storing UTC and as user supplied it both gives you the most flexibility for any representation of date time that your application might need. Not counting that now you are shackled to a vendor like the sibling comment notes, because it's not standard sql
    2. Any solution that does not capture the timezone will be wrong sometimes. Your described solution falls on its face for any situation where an offset doesn't uniquely identify the timezone. For example, Arizona does not recognize daylight savings time, so sometimes it's got the same offset as Mountain Time, other times it has the same offset as Pacific Time.