postgresql/src/backend/utils
Bruce Momjian d7f10705b4 Attached is a patch that limits the range tested by horology to
what is capable using integer-datatime timestamps. It does attempt
to exercise the maximum allowable timestamp range.
Also is a small error check when converting a timestamp from external
to internal format that prevents out of range timestamps from being
entered.

Files patched:
        Index: src/backend/utils/adt/timestamp.c
                Added range check to prevent out of range timestamps
                from being used.

        Index: src/test/regress/sql/horology.sql
        Index: src/test/regress/expected/horology-no-DST-before-1970.out
        Index: src/test/regress/expected/horology-solaris-1947.out
                Limited range of timestamps being checked to
                Jan 1, 4713 BC  to Dec 31, 294276

In creating this patch, I have seen some definite problems with integer
timestamps and how they react when used near their limits. For example,
the following statement gives the correct result:

        SELECT timestamp without time zone 'Jan 1, 4713 BC'
               + interval '109203489 days' AS "Dec 31, 294276";

However, this statement which is the logical inverse of the above
gives incorrect results:

        SELECT timestamp without time zone '12/31/294276'
             - timestamp without time zone 'Jan 1, 4713 BC' AS "109203489 Days";

John Cochran
2003-03-20 06:03:00 +00:00
..
adt Attached is a patch that limits the range tested by horology to 2003-03-20 06:03:00 +00:00
cache Create a distinction between Lists of integers and Lists of OIDs, to get 2003-02-09 06:56:28 +00:00
error Add start time to pg_stat_activity 2003-03-20 03:34:57 +00:00
fmgr More cleanup of userid to be AclId rather than Oid. 2002-12-05 04:04:51 +00:00
hash Got tired of explaining why this Assert is not wrong. 2002-10-31 21:59:32 +00:00
init > I can see a couple possible downsides: (a) the library might have some 2003-03-20 04:51:44 +00:00
mb This patch fixes a bunch of spelling mistakes in comments throughout the 2003-03-10 22:28:22 +00:00
misc > I can see a couple possible downsides: (a) the library might have some 2003-03-20 04:51:44 +00:00
mmgr Implement SQL92-compatible FIRST, LAST, ABSOLUTE n, RELATIVE n options 2003-03-11 19:40:24 +00:00
sort Revise tuplestore and nodeMaterial so that we don't have to read the 2003-03-09 02:19:13 +00:00
time btree page recycling can be done as soon as page's next-xact label is 2003-02-23 23:20:52 +00:00
.cvsignore Cleanup to ensure good state of derived files in tarballs. 2000-06-09 02:38:36 +00:00
Gen_fmgrtab.sh Remove unused system table columns: 2002-07-24 19:11:14 +00:00
Makefile Remove all traces of multibyte and locale options. Clean up comments 2002-09-03 21:45:44 +00:00