Commit 9640666c authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Spiff up discussion of precision on date/time data types.

Add a NetBSD/alpha and update info on a few other platforms.
parent 2d004d7f
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.78 2001/12/08 03:24:22 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.79 2001/12/21 03:54:02 thomas Exp $
--> -->
<chapter id="datatype"> <chapter id="datatype">
...@@ -1328,21 +1328,20 @@ SELECT b, char_length(b) FROM test2; ...@@ -1328,21 +1328,20 @@ SELECT b, char_length(b) FROM test2;
<para> <para>
<type>time</type> and <type>timestamp</type> both accept an <type>time</type> and <type>timestamp</type> both accept an
option precision field <replaceable>p</replaceable> which optional precision field <replaceable>p</replaceable> which
determines the number of digits retained beyond the seconds determines the number of digits retained beyond the seconds
decimal point. By default, there is no explicit bound on precision decimal point. By default, there is no explicit bound on precision
and the actual precision is determined by the underlying double and the actual precision is determined by the underlying double
precision floating point number used to store values in seconds precision floating point number used to store values in seconds
for <type>interval</type> and for <type>interval</type> and
since 2000-01-01 in the case of <type>timestamp</type>. in seconds since 2000-01-01 for <type>timestamp</type>.
</para> </para>
<para> <para>
Time zones, and time-zone conventions, are influenced by Time zones, and time-zone conventions, are influenced by
political decisions, not just physical effects. Time zones have political decisions, not just geometry. Time zones around the
become somewhat standardized around the world during the 1900's, world became somewhat standardized during the 1900's,
but continue to but continue to be prone to arbitrary changes.
be prone to arbitrary changes.
<productname>PostgreSQL</productname> uses your operating <productname>PostgreSQL</productname> uses your operating
system's underlying features to provide time-zone system's underlying features to provide time-zone
support, and these systems usually contain information for only support, and these systems usually contain information for only
...@@ -1354,13 +1353,15 @@ SELECT b, char_length(b) FROM test2; ...@@ -1354,13 +1353,15 @@ SELECT b, char_length(b) FROM test2;
</para> </para>
<para> <para>
To ensure compatibility to earlier versions of <productname>PostgreSQL</productname> To ensure compatibility to earlier versions of
<productname>PostgreSQL</productname>
we continue to provide <type>datetime</type> we continue to provide <type>datetime</type>
(equivalent to <type>timestamp</type>) and (equivalent to <type>timestamp</type>) and
<type>timespan</type> (equivalent to <type>interval</type>), <type>timespan</type> (equivalent to <type>interval</type>),
however support for these is now restricted to having an however support for these is now restricted to having an
implicit translation to <type>timestamp</type> and implicit translation to <type>timestamp</type> and
<type>interval</type>. <type>interval</type>, and these name mappings will be removed in
the next version.
The types <type>abstime</type> The types <type>abstime</type>
and <type>reltime</type> are lower precision types which are used internally. and <type>reltime</type> are lower precision types which are used internally.
You are discouraged from using any of these types in new You are discouraged from using any of these types in new
...@@ -1376,9 +1377,12 @@ SELECT b, char_length(b) FROM test2; ...@@ -1376,9 +1377,12 @@ SELECT b, char_length(b) FROM test2;
Date and time input is accepted in almost any reasonable format, including Date and time input is accepted in almost any reasonable format, including
<acronym>ISO 8601</acronym>, <acronym>SQL</acronym>-compatible, <acronym>ISO 8601</acronym>, <acronym>SQL</acronym>-compatible,
traditional <productname>PostgreSQL</productname>, and others. traditional <productname>PostgreSQL</productname>, and others.
The ordering of month and day in date input can be ambiguous, therefore a setting For some formats, ordering of month and day in date input can be
exists to specify how it should be interpreted in ambiguous cases. The command ambiguous and there is support for specifying the expected
<literal>SET DateStyle TO 'US'</literal> or <literal>SET DateStyle TO 'NonEuropean'</literal> ordering of these fields.
The command
<literal>SET DateStyle TO 'US'</literal>
or <literal>SET DateStyle TO 'NonEuropean'</literal>
specifies the variant <quote>month before day</quote>, the command specifies the variant <quote>month before day</quote>, the command
<literal>SET DateStyle TO 'European'</literal> sets the variant <literal>SET DateStyle TO 'European'</literal> sets the variant
<quote>day before month</quote>. The <literal>ISO</literal> style <quote>day before month</quote>. The <literal>ISO</literal> style
...@@ -1386,24 +1390,29 @@ SELECT b, char_length(b) FROM test2; ...@@ -1386,24 +1390,29 @@ SELECT b, char_length(b) FROM test2;
</para> </para>
<para> <para>
<productname>PostgreSQL</productname> is more flexible in
handling date/time than the
<acronym>SQL</acronym> standard requires.
See <xref linkend="datetime-appendix"> See <xref linkend="datetime-appendix">
for the exact parsing rules of date/time input and for the recognized time zones. for the exact parsing rules of date/time input and for the
recognized time zones.
</para> </para>
<para> <para>
Remember that any date or time input needs to be enclosed into Remember that any date or time literal input needs to be enclosed
single quotes, like text strings. Refer to <xref in single quotes, like text strings. Refer to
linkend="sql-syntax-constants-generic"> for more information. <xref linkend="sql-syntax-constants-generic"> for more
information.
<acronym>SQL9x</acronym> requires the following syntax <acronym>SQL9x</acronym> requires the following syntax
<synopsis> <synopsis>
<replaceable>type</replaceable> [ (<replaceable>p</replaceable>) ] '<replaceable>value</replaceable>' <replaceable>type</replaceable> [ (<replaceable>p</replaceable>) ] '<replaceable>value</replaceable>'
</synopsis> </synopsis>
where <replaceable>p</replaceable> is an integer specifying the where <replaceable>p</replaceable> in the optional precision
number of fractional digits in the seconds field, and is allowed specification is an integer corresponding to the
for <type>time</type>, <type>timestamp</type>, and <type>interval</type> types. number of fractional digits in the seconds field. Precision can
<productname>PostgreSQL</productname> is more flexible in be specified
handling date/time than the for <type>time</type>, <type>timestamp</type>, and
<acronym>SQL</acronym> standard requires. <type>interval</type> types.
</para> </para>
<sect3> <sect3>
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.70 2001/12/19 18:49:56 petere Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.71 2001/12/21 03:54:02 thomas Exp $ -->
<chapter id="installation"> <chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]> <title><![%standalone-include[<productname>PostgreSQL</>]]>
...@@ -1372,9 +1372,10 @@ gunzip -c user.ps.gz \ ...@@ -1372,9 +1372,10 @@ gunzip -c user.ps.gz \
<entry><systemitem class="osname">AIX</></entry> <entry><systemitem class="osname">AIX</></entry>
<entry><systemitem>RS6000</></entry> <entry><systemitem>RS6000</></entry>
<entry>7.2</entry> <entry>7.2</entry>
<entry>2001-11-28, <entry>2001-12-19,
Andreas Zeugswetter (<email>ZeugswetterA@spardat.at</email>)</entry> Andreas Zeugswetter (<email>ZeugswetterA@spardat.at</email>),
<entry>4.3; see also <filename>doc/FAQ_AIX</filename></entry> Tatsuo Ishii (<email>t-ishii@sra.co.jp</email>)</entry>
<entry>see also <filename>doc/FAQ_AIX</filename></entry>
</row> </row>
<row> <row>
<entry><systemitem class="osname">BeOS</></entry> <entry><systemitem class="osname">BeOS</></entry>
...@@ -1392,6 +1393,14 @@ gunzip -c user.ps.gz \ ...@@ -1392,6 +1393,14 @@ gunzip -c user.ps.gz \
Bruce Momjian (<email>pgman@candle.pha.pa.us</email>)</entry> Bruce Momjian (<email>pgman@candle.pha.pa.us</email>)</entry>
<entry>4.2</entry> <entry>4.2</entry>
</row> </row>
<row>
<entry><systemitem class="osname">FreeBSD</></entry>
<entry><systemitem>Alpha</></entry>
<entry>7.2</entry>
<entry>2001-12-18,
Chris Kings-Lynne (<email>chriskl@familyhealth.com.au</email>)</entry>
<entry></entry>
</row>
<row> <row>
<entry><systemitem class="osname">FreeBSD</></entry> <entry><systemitem class="osname">FreeBSD</></entry>
<entry><systemitem>x86</></entry> <entry><systemitem>x86</></entry>
...@@ -1428,9 +1437,9 @@ gunzip -c user.ps.gz \ ...@@ -1428,9 +1437,9 @@ gunzip -c user.ps.gz \
<row> <row>
<entry><systemitem class="osname">Linux</></entry> <entry><systemitem class="osname">Linux</></entry>
<entry><systemitem>armv4l</></entry> <entry><systemitem>armv4l</></entry>
<entry>7.1</entry> <entry>7.2</entry>
<entry>2001-02-22, <entry>2001-12-10,
Mark Knox (<email>markk@pixin.net</email>)</entry> Mark Knox (<email>segfault@hardline.org</email>)</entry>
<entry>2.2.x</entry> <entry>2.2.x</entry>
</row> </row>
<row> <row>
...@@ -1441,6 +1450,14 @@ gunzip -c user.ps.gz \ ...@@ -1441,6 +1450,14 @@ gunzip -c user.ps.gz \
Hisao Shibuya (<email>shibuya@alpha.or.jp</>)</entry> Hisao Shibuya (<email>shibuya@alpha.or.jp</>)</entry>
<entry>2.0.x; <productname>Cobalt Qube2</></entry> <entry>2.0.x; <productname>Cobalt Qube2</></entry>
</row> </row>
<row>
<entry><systemitem class="osname">Linux</></entry>
<entry><systemitem>PlayStation2</></entry>
<entry>7.2</entry>
<entry>2001-12-12,
Permaine Cheung <email>pcheung@redhat.com</email>)</entry>
<entry>#undef HAS_TEST_AND_SET, slock_t</entry>
</row>
<row> <row>
<entry><systemitem class="osname">Linux</></entry> <entry><systemitem class="osname">Linux</></entry>
<entry><systemitem>PPC74xx</></entry> <entry><systemitem>PPC74xx</></entry>
...@@ -1452,9 +1469,9 @@ gunzip -c user.ps.gz \ ...@@ -1452,9 +1469,9 @@ gunzip -c user.ps.gz \
<row> <row>
<entry><systemitem class="osname">Linux</></entry> <entry><systemitem class="osname">Linux</></entry>
<entry><systemitem>S/390</></entry> <entry><systemitem>S/390</></entry>
<entry>7.1</entry> <entry>7.2</entry>
<entry>2000-11-17, <entry>2001-12-12,
Neale Ferguson (<email>Neale.Ferguson@softwareAG-usa.com</email>)</entry> Permaine Cheung <email>pcheung@redhat.com</email>)</entry>
<entry></entry> <entry></entry>
</row> </row>
<row> <row>
...@@ -1565,11 +1582,20 @@ gunzip -c user.ps.gz \ ...@@ -1565,11 +1582,20 @@ gunzip -c user.ps.gz \
<row> <row>
<entry><systemitem class="osname">QNX 4.25</></entry> <entry><systemitem class="osname">QNX 4.25</></entry>
<entry><systemitem>x86</></entry> <entry><systemitem>x86</></entry>
<entry>7.1</entry> <entry>7.2</entry>
<entry>2001-05-24, <entry>2001-12-10,
Bernd Tegge (<email>tegge@repas-aeg.de</email>) Bernd Tegge (<email>tegge@repas-aeg.de</email>)
</entry> </entry>
<entry>see also <filename>doc/FAQ_QNX4</filename></entry> <entry>see also <filename>doc/FAQ_QNX4</filename></entry>
</row>
<row>
<entry><systemitem class="osname">QNX 6</></entry>
<entry><systemitem>x86</></entry>
<entry>7.2</entry>
<entry>2001-12-10,
Igor Kovalenko (<email>Igor.Kovalenko@motorola.com</email>)
</entry>
<entry>Requires patches for Posix semaphores; see archives</entry>
</row> </row>
<row> <row>
<entry><systemitem class="osname">Solaris</></entry> <entry><systemitem class="osname">Solaris</></entry>
...@@ -1587,21 +1613,42 @@ gunzip -c user.ps.gz \ ...@@ -1587,21 +1613,42 @@ gunzip -c user.ps.gz \
Martin Renters (<email>martin@datafax.com</email>)</entry> Martin Renters (<email>martin@datafax.com</email>)</entry>
<entry>2.8; see also <filename>doc/FAQ_Solaris</filename></entry> <entry>2.8; see also <filename>doc/FAQ_Solaris</filename></entry>
</row> </row>
<row>
<entry><systemitem class="osname">SunOS</></entry>
<entry><systemitem>Sparc</></entry>
<entry>7.2</entry>
<entry>2001-12-04, Tatsuo Ishii (<email>t-ishii@sra.co.jp</email>)</entry>
<entry></entry>
</row>
<row> <row>
<entry><systemitem class="osname">Tru64 UNIX</></entry> <entry><systemitem class="osname">Tru64 UNIX</></entry>
<entry><systemitem>Alpha</></entry> <entry><systemitem>Alpha</></entry>
<entry>7.2</entry> <entry>7.2</entry>
<entry>2001-11-26, <entry>2001-11-26,
Alessio Bragadini (<email>alessio@albourne.com</email>)</entry> Alessio Bragadini (<email>alessio@albourne.com</email>),
<entry>4.0g, with cc and gcc</entry> Bernd Tegge (<email>tegge@repas-aeg.de</email>)</entry>
<entry>5.0; 4.0g with cc and gcc</entry>
</row> </row>
<row> <row>
<entry><systemitem class="osname">Windows NT/2000</></entry> <entry><systemitem class="osname">Windows</></entry>
<entry><systemitem>x86</></entry> <entry><systemitem>x86</></entry>
<entry>7.1</entry> <entry>7.2</entry>
<entry>2001-03-16, <entry>2001-12-13,
Dave Page (<email>dpage@vale-housing.co.uk</email>),
Jason Tishler (<email>jason@tishler.net</email>)</entry> Jason Tishler (<email>jason@tishler.net</email>)</entry>
<entry>with <application>Cygwin</application> tool set, see <filename>doc/FAQ_MSWIN</filename></entry> <entry>with <application>Cygwin</application>; see <filename>doc/FAQ_MSWIN</filename></entry>
</row>
<row>
<entry><systemitem class="osname">Windows</></entry>
<entry><systemitem>x86</></entry>
<entry>7.2</entry>
<entry>2001-12-10,
Dave Page (<email>dpage@vale-housing.co.uk</email>)</entry>
<entry>
native is client-side only;
<![%standalone-include[see Administrator's Guide]]>
<![%standalone-ignore[see <xref linkend="install-win32">]]>
</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
...@@ -1668,14 +1715,7 @@ Obsolete platform? This distro was merged into PPC afaik. - thomas 2001-12-07 ...@@ -1668,14 +1715,7 @@ Obsolete platform? This distro was merged into PPC afaik. - thomas 2001-12-07
<entry><systemitem>x86</></entry> <entry><systemitem>x86</></entry>
<entry>6.5</entry> <entry>6.5</entry>
<entry>1999-05-25, Andrew Merrill (<email>andrew@compclass.com</>)</entry> <entry>1999-05-25, Andrew Merrill (<email>andrew@compclass.com</>)</entry>
<entry>7.2 should work, but no reports; see also <filename>doc/FAQ_SCO</filename></entry> <entry>&version; should work, but no reports; see also <filename>doc/FAQ_SCO</filename></entry>
</row>
<row>
<entry><systemitem class="osname">SunOS</></entry>
<entry><systemitem>Sparc</></entry>
<entry>7.2</entry>
<entry>2001-12-04, Tatsuo Ishii (<email>t-ishii@sra.co.jp</email>)</entry>
<entry><function>memcmp()</> does not work correctly, so probably not reliable</entry>
</row> </row>
<row> <row>
<entry><systemitem class="osname">System V R4</></entry> <entry><systemitem class="osname">System V R4</></entry>
...@@ -1703,24 +1743,11 @@ Obsolete platform? This distro was merged into PPC afaik. - thomas 2001-12-07 ...@@ -1703,24 +1743,11 @@ Obsolete platform? This distro was merged into PPC afaik. - thomas 2001-12-07
<entry><systemitem>VAX</></entry> <entry><systemitem>VAX</></entry>
<entry>6.x</entry> <entry>6.x</entry>
<entry>1998-03-01</entry> <entry>1998-03-01</entry>
<entry>no recent reports</entry> <entry></entry>
</row>
<row>
<entry><systemitem class="osname">Windows 9x, ME, NT, 2000</> (native)</entry>
<entry><systemitem>x86</></entry>
<entry>7.1</entry>
<entry>2001-03-26, Magnus Hagander (<email>mha@sollentuna.net</email>)</entry>
<entry>
client-side libraries (<application>libpq</> and <application>psql</>) or ODBC or JDBC, no server-side;
<![%standalone-include[see <citetitle>Administrator's Guide</>]]>
<![%standalone-ignore[see <xref linkend="install-win32">]]>
for instructions
</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
</sect1> </sect1>
</chapter> </chapter>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment