summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-02-19 03:48:11 +0000
committerBruce Momjian <bruce@momjian.us>2003-02-19 03:48:11 +0000
commita286f7321083f06e395959dffeb9b87f028defa0 (patch)
treed5ab53649d5abe11dd393c26ef7ff6b3b5cce96c /doc/src
parent4efbbd731899df673cab4415b9111744d9537a62 (diff)
The following patches eliminate the overflows in the j2date() and date2j()
functions which limited the maximum date for a timestamp to AD 1465001. The new limit is AD 5874897. The files affected are: doc/src/sgml/datatype.sgml: Documentation change due to patch. Included is a notice about the reduced range when using an eight-byte integer for timestamps. src/backend/utils/adt/datetime.c: Replacement functions for j2date() and date2j() functions. src/include/utils/datetime.h: Corrected a bug with the limit on the earliest possible date, Nov 23,-4713 has a Julian day count of -1. The earliest possible date should be Nov 24, -4713 with a day count of 0. src/test/regress/expected/horology-no-DST-before-1970.out: src/test/regress/expected/horology-solaris-1947.out: src/test/regress/expected/horology.out: Copies of expected output for regression testing. Note: Only horology.out has been physically tested. I do not have access to a Solaris box and I don't know how to provoke the "pre-1970" test. src/test/regress/sql/horology.sql: Added some test cases to check extended range. John Cochran
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/datatype.sgml9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 4f166e06bc7..093ce275af4 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.113 2003/01/31 01:08:07 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.114 2003/02/19 03:48:10 momjian Exp $
-->
<chapter id="datatype">
@@ -1243,7 +1243,7 @@ SELECT b, char_length(b) FROM test2;
<entry>both date and time</entry>
<entry>8 bytes</entry>
<entry>4713 BC</entry>
- <entry>AD 1465001</entry>
+ <entry>AD 5874897</entry>
<entry>1 microsecond / 14 digits</entry>
</row>
<row>
@@ -1251,7 +1251,7 @@ SELECT b, char_length(b) FROM test2;
<entry>both date and time</entry>
<entry>8 bytes</entry>
<entry>4713 BC</entry>
- <entry>AD 1465001</entry>
+ <entry>AD 5874897</entry>
<entry>1 microsecond / 14 digits</entry>
</row>
<row>
@@ -1309,7 +1309,8 @@ SELECT b, char_length(b) FROM test2;
a few years of 2000-01-01, but the precision degrades for dates further
away. When timestamps are stored as eight-byte integers (a compile-time
option), microsecond precision is available over the full range of
- values.
+ values. However eight-byte integer timestamps have a reduced range of
+ dates from 4713 BC up to 294276 AD.
</para>
</note>