YSQL TimeZone GUC configuration for regional timestamptz rendering
0 reputation · 02 Sept 2020, 15:23 UTC
YugabyteDB YSQL inherits PostgreSQL date/time semantics for a multi-region deployment that needs regional reporting while keeping storage consistent. The design goal is to store absolute instants uniformly and render local wall-clock values per client region without introducing DST or offset drift in cross-region aggregates.
Constraints are session-scoped. timestamptz is normalized to UTC internally and rendered through the session TimeZone GUC, with AT TIME ZONE conversion using the bundled IANA tz database. The cluster is not region-aware; no node or region automatically applies a local zone. timestamp without time zone drops offset information, so later reads depend on the active session zone. DST correctness depends on the tzdata compiled into the release, meaning historical conversions can shift after a tzdata update.
The unresolved decision is whether to standardize on UTC storage with per-session TimeZone for regional rendering, or to store local timestamps with an explicit zone/offset column for audit fidelity. The choice impacts index semantics, range partitioning by date, and cross-region aggregation correctness.
Is the intended pattern to keep all timestamptz in UTC and set TimeZone per session, role, or database at the regional edge, or to standardize on a cluster-wide TimeZone with application-side conversion? What is the default TimeZone GUC value for the target YugabyteDB release and is it UTC/GMT or host OS derived? Does using timestamp without time zone for local wall-clock columns introduce DST ambiguity for historical queries after tzdata updates?