Skip to content

Commit c5c28ed

Browse files
author
Thomas G. Lockhart
committed
Add more complete details on date/time keywords and parsing rules.
Move some tabular information on these from the chapter on data types to the appendix on dates and times.
1 parent c826d1c commit c5c28ed

File tree

2 files changed

+257
-139
lines changed

2 files changed

+257
-139
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 26 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.81 2001/12/29 18:35:46 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.82 2002/01/04 17:02:02 thomas Exp $
33
-->
44

55
<chapter id="datatype">
@@ -1346,29 +1346,35 @@ SELECT b, char_length(b) FROM test2;
13461346

13471347
<para>
13481348
Time zones, and time-zone conventions, are influenced by
1349-
political decisions, not just geometry. Time zones around the
1349+
political decisions, not just earth geometry. Time zones around the
13501350
world became somewhat standardized during the 1900's,
13511351
but continue to be prone to arbitrary changes.
13521352
<productname>PostgreSQL</productname> uses your operating
1353-
system's underlying features to provide time-zone
1353+
system's underlying features to provide output time-zone
13541354
support, and these systems usually contain information for only
13551355
the time period 1902 through 2038 (corresponding to the full
13561356
range of conventional Unix system time).
1357-
<type>timestamp with time zone</type> will use time zone
1358-
information only within that year range, and assumes that times
1359-
are in UTC outside that range.
1357+
<type>timestamp with time zone</type> and <type>time with time
1358+
zone</type> will use time zone
1359+
information only within that year range, and assume that times
1360+
outside that range are in <acronym>UTC</acronym>.
13601361
</para>
13611362

13621363
<para>
1363-
To ensure compatibility to earlier versions of
1364-
<productname>PostgreSQL</productname>
1365-
we continue to provide <type>datetime</type>
1364+
To ensure an upgrade path from versions of
1365+
<productname>PostgreSQL</productname> earlier than 7.0,
1366+
we recognize <type>datetime</type>
13661367
(equivalent to <type>timestamp</type>) and
1367-
<type>timespan</type> (equivalent to <type>interval</type>),
1368-
however support for these is now restricted to having an
1368+
<type>timespan</type> (equivalent to <type>interval</type>).
1369+
These types are
1370+
now restricted to having an
13691371
implicit translation to <type>timestamp</type> and
1370-
<type>interval</type>, and these name mappings will be removed in
1371-
the next version.
1372+
<type>interval</type>, and
1373+
support for these will be removed in the next release of
1374+
<productname>PostgreSQL</productname> (likely named 7.3).
1375+
</para>
1376+
1377+
<para>
13721378
The types <type>abstime</type>
13731379
and <type>reltime</type> are lower precision types which are used internally.
13741380
You are discouraged from using any of these types in new
@@ -1402,7 +1408,8 @@ SELECT b, char_length(b) FROM test2;
14021408
<acronym>SQL</acronym> standard requires.
14031409
See <xref linkend="datetime-appendix">
14041410
for the exact parsing rules of date/time input and for the
1405-
recognized time zones.
1411+
recognized text fields including months, days of the week, and
1412+
time zones.
14061413
</para>
14071414

14081415
<para>
@@ -1431,7 +1438,7 @@ SELECT b, char_length(b) FROM test2;
14311438
</indexterm>
14321439

14331440
<para>
1434-
The following are possible inputs for the <type>date</type> type.
1441+
The following are some possible inputs for the <type>date</type> type.
14351442

14361443
<table tocentry="1">
14371444
<title>Date Input</title>
@@ -1480,118 +1487,12 @@ SELECT b, char_length(b) FROM test2;
14801487
<entry>Year and day of year</entry>
14811488
</row>
14821489
<row>
1483-
<entry>January 8, 99 BC</entry>
1484-
<entry>Year 99 before the Common Era</entry>
1485-
</row>
1486-
</tbody>
1487-
</tgroup>
1488-
</table>
1489-
</para>
1490-
1491-
<para>
1492-
<table tocentry="1">
1493-
<title>Month Abbreviations</title>
1494-
<tgroup cols="2">
1495-
<thead>
1496-
<row>
1497-
<entry>Month</entry>
1498-
<entry>Abbreviations</entry>
1499-
</row>
1500-
</thead>
1501-
<tbody>
1502-
<row>
1503-
<entry>April</entry>
1504-
<entry>Apr</entry>
1505-
</row>
1506-
<row>
1507-
<entry>August</entry>
1508-
<entry>Aug</entry>
1509-
</row>
1510-
<row>
1511-
<entry>December</entry>
1512-
<entry>Dec</entry>
1513-
</row>
1514-
<row>
1515-
<entry>February</entry>
1516-
<entry>Feb</entry>
1517-
</row>
1518-
<row>
1519-
<entry>January</entry>
1520-
<entry>Jan</entry>
1521-
</row>
1522-
<row>
1523-
<entry>July</entry>
1524-
<entry>Jul</entry>
1525-
</row>
1526-
<row>
1527-
<entry>June</entry>
1528-
<entry>Jun</entry>
1529-
</row>
1530-
<row>
1531-
<entry>March</entry>
1532-
<entry>Mar</entry>
1533-
</row>
1534-
<row>
1535-
<entry>November</entry>
1536-
<entry>Nov</entry>
1537-
</row>
1538-
<row>
1539-
<entry>October</entry>
1540-
<entry>Oct</entry>
1541-
</row>
1542-
<row>
1543-
<entry>September</entry>
1544-
<entry>Sep, Sept</entry>
1545-
</row>
1546-
</tbody>
1547-
</tgroup>
1548-
</table>
1549-
1550-
<note>
1551-
<para>
1552-
The month <literal>May</literal> has no explicit abbreviation, for obvious reasons.
1553-
</para>
1554-
</note>
1555-
</para>
1556-
1557-
<para>
1558-
<table tocentry="1">
1559-
<title>Day of the Week Abbreviations</title>
1560-
<tgroup cols="2">
1561-
<thead>
1562-
<row>
1563-
<entry>Day</entry>
1564-
<entry>Abbreviation</entry>
1490+
<entry>J2451187</entry>
1491+
<entry>Julian day</entry>
15651492
</row>
1566-
</thead>
1567-
<tbody>
15681493
<row>
1569-
<entry>Sunday</entry>
1570-
<entry>Sun</entry>
1571-
</row>
1572-
<row>
1573-
<entry>Monday</entry>
1574-
<entry>Mon</entry>
1575-
</row>
1576-
<row>
1577-
<entry>Tuesday</entry>
1578-
<entry>Tue, Tues</entry>
1579-
</row>
1580-
<row>
1581-
<entry>Wednesday</entry>
1582-
<entry>Wed, Weds</entry>
1583-
</row>
1584-
<row>
1585-
<entry>Thursday</entry>
1586-
<entry>Thu, Thur, Thurs</entry>
1587-
</row>
1588-
<row>
1589-
<entry>Friday</entry>
1590-
<entry>Fri</entry>
1591-
</row>
1592-
<row>
1593-
<entry>Saturday</entry>
1594-
<entry>Sat</entry>
1494+
<entry>January 8, 99 BC</entry>
1495+
<entry>Year 99 before the Common Era</entry>
15951496
</row>
15961497
</tbody>
15971498
</tgroup>
@@ -1655,14 +1556,6 @@ SELECT b, char_length(b) FROM test2;
16551556
<entry>04:05 PM</entry>
16561557
<entry>Same as 16:05; input hour must be <= 12</entry>
16571558
</row>
1658-
<row>
1659-
<entry>z</entry>
1660-
<entry>Same as 00:00:00</entry>
1661-
</row>
1662-
<row>
1663-
<entry>zulu</entry>
1664-
<entry>Same as 00:00:00</entry>
1665-
</row>
16661559
<row>
16671560
<entry>allballs</entry>
16681561
<entry>Same as 00:00:00</entry>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy