summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTom Lane2025-02-07 17:40:41 +0000
committerTom Lane2025-02-07 17:40:41 +0000
commit480acbbd426863fbaddf0606325e9a49e40bd86c (patch)
treeb2c027bad2c16c56b2552b0105283df6ccb5b0e0 /doc
parent572ec03cbec4690eeb5c1047b378626fe475d218 (diff)
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 <[email protected]> Co-authored-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: 13
Diffstat (limited to 'doc')
-rw-r--r--doc/src/sgml/datatype.sgml17
-rw-r--r--doc/src/sgml/glossary.sgml16
2 files changed, 26 insertions, 7 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index e0d33f12e1c..cd82c1c17e0 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'
<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>
diff --git a/doc/src/sgml/glossary.sgml b/doc/src/sgml/glossary.sgml
index 405fe6dc8b9..7e053cf205a 100644
--- a/doc/src/sgml/glossary.sgml
+++ b/doc/src/sgml/glossary.sgml
@@ -851,6 +851,11 @@
</glossdef>
</glossentry>
+ <glossentry>
+ <glossterm>GMT</glossterm>
+ <glosssee otherterm="glossary-utc" />
+ </glossentry>
+
<glossentry id="glossary-grant">
<glossterm>Grant</glossterm>
<glossdef>
@@ -2037,6 +2042,17 @@
</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>