1. 19 2月, 2003 1 次提交
    • B
      The following patches eliminate the overflows in the j2date() and date2j() · a286f732
      Bruce Momjian 提交于
      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
      a286f732
  2. 31 1月, 2003 1 次提交
  3. 19 9月, 2002 1 次提交
    • T
      Extend pg_cast castimplicit column to a three-way value; this allows us · b26dfb95
      Tom Lane 提交于
      to be flexible about assignment casts without introducing ambiguity in
      operator/function resolution.  Introduce a well-defined promotion hierarchy
      for numeric datatypes (int2->int4->int8->numeric->float4->float8).
      Change make_const to initially label numeric literals as int4, int8, or
      numeric (never float8 anymore).
      Explicitly mark Func and RelabelType nodes to indicate whether they came
      from a function call, explicit cast, or implicit cast; use this to do
      reverse-listing more accurately and without so many heuristics.
      Explicit casts to char, varchar, bit, varbit will truncate or pad without
      raising an error (the pre-7.2 behavior), while assigning to a column without
      any explicit cast will still raise an error for wrong-length data like 7.3.
      This more nearly follows the SQL spec than 7.2 behavior (we should be
      reporting a 'completion condition' in the explicit-cast cases, but we have
      no mechanism for that, so just do silent truncation).
      Fix some problems with enforcement of typmod for array elements;
      it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
      Provide a generalized array_length_coerce() function to replace the
      specialized per-array-type functions that used to be needed (and were
      missing for NUMERIC as well as all the datetime types).
      Add missing conversions int8<->float4, text<->numeric, oid<->int8.
      initdb forced.
      b26dfb95
  4. 22 4月, 2002 1 次提交
    • T
      Support alternate storage scheme of 64-bit integer for date/time types. · 547df0cc
      Thomas G. Lockhart 提交于
       Use "--enable-integer-datetimes" in configuration to use this rather
       than the original float8 storage. I would recommend the integer-based
       storage for any platform on which it is available. We perhaps should
       make this the default for the production release.
      Change timezone(timestamptz) results to return timestamp rather than
       a character string. Formerly, we didn't have a way to represent
       timestamps with an explicit time zone other than freezing the info into
       a string. Now, we can reasonably omit the explicit time zone from the
       result and return a timestamp with values appropriate for the specified
       time zone. Much cleaner, and if you need the time zone in the result
       you can put it into a character string pretty easily anyway.
      Allow fractional seconds in date/time types even for dates prior to 1BC.
      Limit timestamp data types to 6 decimal places of precision. Just right
       for a micro-second storage of int8 date/time types, and reduces the
       number of places ad-hoc rounding was occuring for the float8-based types.
      Use lookup tables for precision/rounding calculations for timestamp and
       interval types.  Formerly used pow() to calculate the desired value but
       with a more limited range there is no reason to not type in a lookup
       table. Should be *much* better performance, though formerly there were
       some optimizations to help minimize the number of times pow() was called.
      Define a HAVE_INT64_TIMESTAMP variable. Based on the configure option
       "--enable-integer-datetimes" and the existing internal INT64_IS_BUSTED.
      Add explicit date/interval operators and functions for addition and
       subtraction. Formerly relied on implicit type promotion from date to
       timestamp with time zone.
      Change timezone conversion functions for the timetz type from "timetz()"
       to "timezone()". This is consistant with other time zone coersion
       functions for other types.
      Bump the catalog version to 200204201.
      Fix up regression tests to reflect changes in fractional seconds
       representation for date/times in BC eras.
      All regression tests pass on my Linux box.
      547df0cc
  5. 12 1月, 2002 1 次提交
    • T
      Repair bugs in declarations of routines to add timestamptz and interval. · 192061e4
      Thomas G. Lockhart 提交于
       Thanks to Bruce for spotting it and Tom Lane for diagnosing it.
      Since horology test output is changing anyway, add some date/time input
       tests to horology.sql. Some of these should move to the tests for the
       individual data types, and we perhaps should add an entire new test
       for "timezone" to allow manipulating the current time zone without
       risking damage to the results of other tests.
      192061e4
  6. 22 11月, 2001 1 次提交
  7. 07 11月, 2001 1 次提交
  8. 19 10月, 2001 1 次提交
    • T
      Accept an INTERVAL argument for SET TIME ZONE per SQL99. · 9310075a
      Thomas G. Lockhart 提交于
       Modified the parser and the SET handlers to use full Node structures
       rather than simply a character string argument.
      Implement INTERVAL() YEAR TO MONTH (etc) syntax per SQL99.
       Does not yet accept the goofy string format that goes along with, but
       this should be fairly straight forward to fix now as a bug or later
       as a feature.
      Implement precision for the INTERVAL() type.
       Use the typmod mechanism for both of INTERVAL features.
      Fix the INTERVAL syntax in the parser:
       opt_interval was in the wrong place.
      INTERVAL is now a reserved word, otherwise we get reduce/reduce errors.
      Implement an explicit date_part() function for TIMETZ.
       Should fix coersion problem with INTERVAL reported by Peter E.
      Fix up some error messages for date/time types.
       Use all caps for type names within message.
      Fix recently introduced side-effect bug disabling 'epoch' as a recognized
       field for date_part() etc. Reported by Peter E. (??)
      Bump catalog version number.
      Rename "microseconds" current transaction time field
       from ...Msec to ...Usec. Duh!
      date/time regression tests updated for reference platform, but a few
       changes will be necessary for others.
      9310075a
  9. 03 10月, 2001 1 次提交
    • T
      Implement precision support for timestamp and time, both with and without · 3e1beda2
      Thomas G. Lockhart 提交于
       time zones.
      SQL99 spec requires a default of zero (round to seconds) which is set
       in gram.y as typmod is set in the parse tree. We *could* change to a
       default of either 6 (for internal compatibility with previous versions)
       or 2 (for external compatibility with previous versions).
      Evaluate entries in pg_proc wrt the iscachable attribute for timestamp and
       other date/time types. Try to recognize cases where side effects like the
       current time zone setting may have an effect on results to decide whether
       something is cachable or not.
      3e1beda2
  10. 29 9月, 2001 1 次提交
  11. 28 9月, 2001 1 次提交
  12. 19 6月, 2001 1 次提交
  13. 06 4月, 2001 1 次提交
  14. 05 4月, 2001 1 次提交
  15. 03 12月, 2000 1 次提交
    • T
      Repair usage of the OVERLAPS operator. · 6969b8fa
      Thomas G. Lockhart 提交于
      Allow some operator-like tokens to be used as function names.
      Flesh out support for time, timetz, and interval operators
       and interactions.
      Regression tests pass, but non-reference-platform horology test results
       will need to be updated.
      6969b8fa
  16. 14 9月, 2000 1 次提交
  17. 12 9月, 2000 1 次提交
  18. 17 3月, 2000 1 次提交
  19. 16 3月, 2000 1 次提交
  20. 10 3月, 2000 1 次提交
  21. 17 2月, 2000 1 次提交
    • T
      All regression tests pass except for rules.sql (unrelated). · 8997675c
      Thomas G. Lockhart 提交于
      Implement "date/time grand unification".
       Transform datetime and timespan into timestamp and interval.
       Deprecate datetime and timespan, though translate to new types in gram.y.
       Transform all datetime and timespan catalog entries into new types.
       Make "INTERVAL" reserved word allowed as a column identifier in gram.y.
       Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility
        routines for all date/time types.
       date.{h,c} now deals with date, time types.
       timestamp.{h,c} now deals with timestamp, interval types.
       nabstime.{h,c} now deals with abstime, reltime, tinterval types.
      Make NUMERIC a known native type for purposes of type coersion. Not tested.
      8997675c
  22. 05 1月, 2000 1 次提交
    • T
      Clean up format of tests. · 4c4e68dc
      Thomas G. Lockhart 提交于
      Remove older "::" type coersion syntax in favor of extended SQL92 style.
      Include a few new tests for datetime/timespan arithmetic.
      4c4e68dc
  23. 21 9月, 1997 1 次提交
  24. 01 7月, 1997 1 次提交
  25. 23 6月, 1997 1 次提交
  26. 11 5月, 1997 1 次提交