Mention new AT TIME ZONE feature.

This commit is contained in:
Thomas G. Lockhart 2000-11-11 19:50:31 +00:00
parent bc20c41275
commit ecc367b764

View File

@ -1,5 +1,5 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.39 2000/11/10 20:13:25 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.40 2000/11/11 19:50:31 thomas Exp $
--> -->
<chapter id="datatype"> <chapter id="datatype">
@ -1248,29 +1248,34 @@ January 8 04:05:06 1999 PST
Although the <type>date</type> type Although the <type>date</type> type
does not have an associated time zone, the does not have an associated time zone, the
<type>time</type> type can or does. <type>time</type> type can or does.
Time zones in the real world can have no meaning unless
associated with a date as well as a time
since the offset may vary through the year with daylight savings
time boundaries.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
The default time zone is specified as a constant integer offset The default time zone is specified as a constant integer offset
from GMT/UTC. from GMT/UTC. It is not possible to adapt to daylight savings
time when doing date/time arithmetic across
<acronym>DST</acronym> boundaries.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
Time zones in the real world can have no meaning unless
associated with a date as well as a time
since the offset may vary through the year with daylight savings
time boundaries.
</para> </para>
<para> <para>
To address these difficulties, <productname>Postgres</productname> To address these difficulties, we recommend using date/time
associates time zones only with date and time types which contain both date and time when using time zones. We
types which contain both date and time, recommend <emphasis>not</emphasis> using the SQL92 type TIME
and assumes local time for any type containing only WITH TIME ZONE (though it is supported by
<productname>Postgres</productname> for legacy applications and
for compatibility with other RDBMS implementations).
<productname>Postgres</productname>
assumes local time for any type containing only
date or time. Further, time zone support is derived from date or time. Further, time zone support is derived from
the underlying operating system the underlying operating system
time zone capabilities, and hence can handle daylight savings time time zone capabilities, and hence can handle daylight savings time
@ -1286,8 +1291,8 @@ January 8 04:05:06 1999 PST
</para> </para>
<para> <para>
All dates and times are stored internally in Universal UTC, All dates and times are stored internally in UTC,
alternately known as Greenwich Mean Time (GMT). traditionally known as Greenwich Mean Time (GMT).
Times are converted to local time on the database server before being Times are converted to local time on the database server before being
sent to the client frontend, hence by default are in the server sent to the client frontend, hence by default are in the server
time zone. time zone.
@ -1299,7 +1304,7 @@ January 8 04:05:06 1999 PST
<itemizedlist spacing="compact" mark="bullet"> <itemizedlist spacing="compact" mark="bullet">
<listitem> <listitem>
<para> <para>
The TZ environment variable used by the backend directly The TZ environment variable is used by the backend directly
on postmaster start-up as the default time zone. on postmaster start-up as the default time zone.
</para> </para>
</listitem> </listitem>
@ -1315,15 +1320,27 @@ January 8 04:05:06 1999 PST
sets the time zone for the session. sets the time zone for the session.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
The <acronym>SQL92</acronym> qualifier on
<programlisting>
<replaceable>timestamp</replaceable> AT TIME ZONE '<replaceable>zone</replaceable>'
</programlisting>
where <replaceable>zone</replaceable> can be specified as a
text time zone (e.g. <literal>'PST'</literal>) or as an
interval (e.g. <literal>INTERVAL '-08:00'</literal>).
</para>
</listitem>
</itemizedlist> </itemizedlist>
</para> </para>
<para> <para>
If an invalid time zone is specified, <note>
the time zone becomes GMT (on most systems anyway). <para>
</para> If an invalid time zone is specified,
the time zone becomes GMT (on most systems anyway).
<para> </para>
</note>
<note> <note>
<para> <para>
@ -1889,6 +1906,10 @@ January 8 04:05:06 1999 PST
</tgroup> </tgroup>
</table> </table>
</para> </para>
</sect2>
<sect2 id="inet-type">
<title><type>inet</type></title>
<para> <para>
The essential difference between <type>inet</type> and <type>cidr</type> The essential difference between <type>inet</type> and <type>cidr</type>