Footguns with Postgres "at time zone 'UTC'"
Πρωτότυπος τίτλος: "Footguns with Postgres "at time zone 'UTC'"" (από birdculture)
Σύνοψη για το άρθρο "Footguns with Postgres "at time zone 'UTC'"".
Περίληψη
[Σημείωση: Το αρχικό άρθρο δεν ήταν άμεσα προσβάσιμο μέσω scraper. Ακολουθούν τα κορυφαία τεχνικά σχόλια της κοινότητας του Hacker News]:
[Σχόλιο από Felk]: I think most of the confusuion comes from "AT TIME ZONE" being the syntax for both the conversion from and to timezone'd timestamps. Maybe it would have been more intuitive had the two operations gotten different wordings, e.g.:
timestamp to timestamptz: AS ZONED AT TIME ZONE ...
timestamptz to timestamp: AS LOCAL AT TIME ZONE ...
[Σχόλιο από ForHackernews]: Postgres 'at time zone' is confusing, but it's internally consistent. Once you understand what it's doing, you can work with it and it will reliably behave the way it's designed to.
https://oneuptime.com/blog/post/2026-01-25-postgresql-timezone-handling/view#converting-between-timezones
-- TIMESTAMPTZ AT TIME ZONE 'X' -> returns TIMESTAMP in timezone X
-- TIMESTAMP AT TIME ZONE 'X' -> returns TIMESTAMPTZ treating input as timez...
Ανακαλύψτε καινοτόμα open-source εργαλεία και κρυμμένα διαμάντια ανοιχτού κώδικα.