From 31ca4653176fa06eed8d04d6c93c813f93d8d8eb Mon Sep 17 00:00:00 2001 From: Danny Xu Date: Mon, 2 Nov 2026 15:03:10 +0000 Subject: [PATCH] Drop the timestamptz session TimeZone patch The patch converted timestamptz values into the session TimeZone, calling time.LoadLocation on the name PostgreSQL reports and returning the error when that failed. PostgreSQL accepts TimeZone settings that are not IANA names -- '+08:00', 'GMT+8', '-7', reported back as POSIX specs such as '<-07>+07' -- so for those sessions every timestamptz read failed with "unknown time zone" instead of returning a row. The decoded instant was never wrong, only the location it was displayed in, so the conversion belongs in the caller, where a name Go cannot load can fall back to the offset the server reports. Those zones are fixed offsets with no DST, so a fixed zone is exact rather than an approximation. ColumnTypePrecisionScale is now the fork's only patch. Co-Authored-By: Claude Opus 5 --- stdlib/sql.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/stdlib/sql.go b/stdlib/sql.go index 8f8940c94..b1907c484 100644 --- a/stdlib/sql.go +++ b/stdlib/sql.go @@ -852,16 +852,6 @@ func (r *Rows) initValueFuncs() { if err != nil { return nil, err } - - if d.InfinityModifier == pgtype.Finite { - timezone := r.conn.conn.PgConn().ParameterStatus("TimeZone") - lc, err := time.LoadLocation(timezone) - if err != nil { - return nil, err - } - d.Time = d.Time.In(lc) - } - return d.Value() } case pgtype.XMLOID: