Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Doc: clarify behavior of timestamptz input some more.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Feb 2025 17:40:41 +0000 (12:40 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Feb 2025 17:40:41 +0000 (12:40 -0500)
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 <rob@xzilla.net>
Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/173796426022.1064.9135167366862649513@wrigleys.postgresql.org
Backpatch-through: 13

doc/src/sgml/datatype.sgml
doc/src/sgml/glossary.sgml

index e6b975dfd0ea8a2424214ec59ff2acfce863454d..6d069650ffc40df40fe63acb3863b7d5149faf0f 100644 (file)
@@ -2141,24 +2141,27 @@ TIMESTAMP '2004-10-19 10:23:54+02'
 <programlisting>
 TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02'
 </programlisting>
+     </para>
 
-      In a literal that has been determined to be <type>timestamp without time
+     <para>
+      In a value that has been determined to be <type>timestamp without time
       zone</type>, <productname>PostgreSQL</productname> 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.
+      fields in the input string, and is not adjusted for time zone.
      </para>
 
      <para>
-      For <type>timestamp with time zone</type>, the internally stored
-      value is always in UTC (Universal
-      Coordinated Time, traditionally known as Greenwich Mean Time,
-      <acronym>GMT</acronym>).  An input value that has an explicit
-      time zone specified is converted to UTC using the appropriate offset
+      For <type>timestamp with time zone</type> values, an input string
+      that includes an explicit time zone will be converted to UTC
+      (<glossterm linkend="glossary-utc">Universal Coordinated
+      Time</glossterm>) 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
       <xref linkend="guc-timezone"/> parameter, and is converted to UTC using the
       offset for the <varname>timezone</varname> zone.
+      In either case, the value is stored internally as UTC, and the
+      originally stated or assumed time zone is not retained.
      </para>
 
      <para>
index 9779f341b914bfcd5f20944fbdd20726f69f6f92..1a5e2256454fbc790a3e67014bb777ebb786bcc5 100644 (file)
    </glossdef>
   </glossentry>
 
+  <glossentry>
+   <glossterm>GMT</glossterm>
+   <glosssee otherterm="glossary-utc" />
+  </glossentry>
+
   <glossentry id="glossary-grant">
    <glossterm>Grant</glossterm>
    <glossdef>
    </glossdef>
   </glossentry>
 
+  <glossentry id="glossary-utc">
+   <glossterm>UTC</glossterm>
+   <glossdef>
+    <para>
+     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).
+    </para>
+   </glossdef>
+  </glossentry>
+
   <glossentry id="glossary-vacuum">
    <glossterm>Vacuum</glossterm>
    <glossdef>