Does DuckDB convert TIMESTAMP WITH TIME ZONE to UTC on insert, or ignore the zone?
0 reputation · 21 Apr 2023, 07:07 UTC
DuckDB documentation describes TIMESTAMP WITH TIME ZONE as syntactic sugar that stores values in UTC, yet the exact conversion path during insertion and retrieval is not always clear. The goal is to determine whether the engine applies the zone offset to produce a UTC instant, or whether it preserves the wall-clock time and discards the zone metadata. This distinction affects how applications should interpret historical timestamps and whether AT TIME ZONE can be relied upon for display conversions.
Release notes and parser behavior may differ across major versions, with some older releases enforcing UTC more strictly and newer releases accepting the syntax without applying the offset. Because the source code and current release notes have not been inspected in this context, the precise version boundary and the intended semantics of AT TIME ZONE on a UTC-backed value remain unverified.
Does DuckDB convert a TIMESTAMP WITH TIME ZONE literal to UTC on insert, or does it store the local time and ignore the zone? Which release introduced the current behavior where the zone qualifier is accepted but not applied? What offset adjustment, if any, does AT TIME ZONE perform when the underlying value is already normalized to UTC?