1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.39 2000/11/10 20:13:25 tgl Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.40 2000/11/11 19:50:31 thomas Exp $
3
3
-->
4
4
5
5
<chapter id="datatype">
@@ -1248,29 +1248,34 @@ January 8 04:05:06 1999 PST
1248
1248
Although the <type>date</type> type
1249
1249
does not have an associated time zone, the
1250
1250
<type>time</type> type can or does.
1251
+ Time zones in the real world can have no meaning unless
1252
+ associated with a date as well as a time
1253
+ since the offset may vary through the year with daylight savings
1254
+ time boundaries.
1251
1255
</para>
1252
1256
</listitem>
1253
1257
1254
1258
<listitem>
1255
1259
<para>
1256
1260
The default time zone is specified as a constant integer offset
1257
- from GMT/UTC.
1261
+ from GMT/UTC. It is not possible to adapt to daylight savings
1262
+ time when doing date/time arithmetic across
1263
+ <acronym>DST</acronym> boundaries.
1258
1264
</para>
1259
1265
</listitem>
1260
1266
1261
1267
</itemizedlist>
1262
-
1263
- Time zones in the real world can have no meaning unless
1264
- associated with a date as well as a time
1265
- since the offset may vary through the year with daylight savings
1266
- time boundaries.
1267
1268
</para>
1268
1269
1269
1270
<para>
1270
- To address these difficulties, <productname>Postgres</productname>
1271
- associates time zones only with date and time
1272
- types which contain both date and time,
1273
- and assumes local time for any type containing only
1271
+ To address these difficulties, we recommend using date/time
1272
+ types which contain both date and time when using time zones. We
1273
+ recommend <emphasis>not</emphasis> using the SQL92 type TIME
1274
+ WITH TIME ZONE (though it is supported by
1275
+ <productname>Postgres</productname> for legacy applications and
1276
+ for compatibility with other RDBMS implementations).
1277
+ <productname>Postgres</productname>
1278
+ assumes local time for any type containing only
1274
1279
date or time. Further, time zone support is derived from
1275
1280
the underlying operating system
1276
1281
time zone capabilities, and hence can handle daylight savings time
@@ -1286,8 +1291,8 @@ January 8 04:05:06 1999 PST
1286
1291
</para>
1287
1292
1288
1293
<para>
1289
- All dates and times are stored internally in Universal UTC,
1290
- alternately known as Greenwich Mean Time (GMT).
1294
+ All dates and times are stored internally in UTC,
1295
+ traditionally known as Greenwich Mean Time (GMT).
1291
1296
Times are converted to local time on the database server before being
1292
1297
sent to the client frontend, hence by default are in the server
1293
1298
time zone.
@@ -1299,7 +1304,7 @@ January 8 04:05:06 1999 PST
1299
1304
<itemizedlist spacing="compact" mark="bullet">
1300
1305
<listitem>
1301
1306
<para>
1302
- The TZ environment variable used by the backend directly
1307
+ The TZ environment variable is used by the backend directly
1303
1308
on postmaster start-up as the default time zone.
1304
1309
</para>
1305
1310
</listitem>
@@ -1315,15 +1320,27 @@ January 8 04:05:06 1999 PST
1315
1320
sets the time zone for the session.
1316
1321
</para>
1317
1322
</listitem>
1323
+ <listitem>
1324
+ <para>
1325
+ The <acronym>SQL92</acronym> qualifier on
1326
+ <programlisting>
1327
+ <replaceable>timestamp</replaceable> AT TIME ZONE '<replaceable>zone</replaceable>'
1328
+ </programlisting>
1329
+ where <replaceable>zone</replaceable> can be specified as a
1330
+ text time zone (e.g. <literal>'PST'</literal>) or as an
1331
+ interval (e.g. <literal>INTERVAL '-08:00'</literal>).
1332
+ </para>
1333
+ </listitem>
1318
1334
</itemizedlist>
1319
1335
</para>
1320
1336
1321
1337
<para>
1322
- If an invalid time zone is specified,
1323
- the time zone becomes GMT (on most systems anyway).
1324
- </para>
1325
-
1326
- <para>
1338
+ <note>
1339
+ <para>
1340
+ If an invalid time zone is specified,
1341
+ the time zone becomes GMT (on most systems anyway).
1342
+ </para>
1343
+ </note>
1327
1344
1328
1345
<note>
1329
1346
<para>
@@ -1889,6 +1906,10 @@ January 8 04:05:06 1999 PST
1889
1906
</tgroup>
1890
1907
</table>
1891
1908
</para>
1909
+ </sect2>
1910
+
1911
+ <sect2 id="inet-type">
1912
+ <title><type>inet</type></title>
1892
1913
1893
1914
<para>
1894
1915
The essential difference between <type>inet</type> and <type>cidr</type>
0 commit comments