From 11bba6e49407cbaa3a9cd317bb3a1f08b8c5609b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 7 Feb 2025 12:40:41 -0500 Subject: [PATCH] Doc: clarify behavior of timestamptz input some more. Try to make it absolutely plain that we don't retain the originally specified time zone, only the UTC timestamp. While at it, make glossary entries for "UTC" and "GMT". Author: Robert Treat Co-authored-by: Tom Lane Discussion: https://postgr.es/m/173796426022.1064.9135167366862649513@wrigleys.postgresql.org Backpatch-through: 13 --- doc/src/sgml/datatype.sgml | 25 ++++++++++++++----------- doc/src/sgml/glossary.sgml | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 1d9127e94e4..b20241feb50 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -2245,24 +2245,27 @@ TIMESTAMP '2004-10-19 10:23:54+02' TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02' - - In a literal that has been determined to be timestamp without time - zone, PostgreSQL will silently ignore - any time zone indication. - That is, the resulting value is derived from the date/time - fields in the input value, and is not adjusted for time zone. - For timestamp with time zone, the internally stored - value is always in UTC (Universal - Coordinated Time, traditionally known as Greenwich Mean Time, - GMT). An input value that has an explicit - time zone specified is converted to UTC using the appropriate offset + In a value that has been determined to be timestamp without time + zone, PostgreSQL will silently ignore + any time zone indication. + That is, the resulting value is derived from the date/time + fields in the input string, and is not adjusted for time zone. + + + + For timestamp with time zone values, an input string + that includes an explicit time zone will be converted to UTC + (Universal Coordinated + Time) using the appropriate offset for that time zone. If no time zone is stated in the input string, then it is assumed to be in the time zone indicated by the system's parameter, and is converted to UTC using the offset for the timezone zone. + In either case, the value is stored internally as UTC, and the + originally stated or assumed time zone is not retained. diff --git a/doc/src/sgml/glossary.sgml b/doc/src/sgml/glossary.sgml index f54f25c1c6b..c0f812e3f5e 100644 --- a/doc/src/sgml/glossary.sgml +++ b/doc/src/sgml/glossary.sgml @@ -851,6 +851,11 @@ + + GMT + + + Grant @@ -2047,6 +2052,17 @@ + + UTC + + + Universal Coordinated Time, the primary global time reference, + approximately the time prevailing at the zero meridian of longitude. + Often but inaccurately referred to as GMT (Greenwich Mean Time). + + + + Vacuum