diff options
| author | Tom Lane | 2006-09-04 01:26:28 +0000 |
|---|---|---|
| committer | Tom Lane | 2006-09-04 01:26:28 +0000 |
| commit | 57bfb27e60055c10e42b87e68a894720c2f78e70 (patch) | |
| tree | ae27e5eb9686177b0668385abe023a169e656227 /src/test/regress | |
| parent | 091fe037757abbecd6994daea0ae4eaa87f7217e (diff) | |
Fix interval input parser so that fractional weeks and months are
cascaded first to days and only what is leftover into seconds. This
seems to satisfy the principle of least surprise given the general
conversion to three-part interval values --- it was an oversight that
these cases weren't dealt with in 8.1. Michael Glaesemann
Diffstat (limited to 'src/test/regress')
| -rw-r--r-- | src/test/regress/expected/interval.out | 12 | ||||
| -rw-r--r-- | src/test/regress/sql/interval.sql | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/test/regress/expected/interval.out b/src/test/regress/expected/interval.out index 0adda4a981d..3a5fb12cbc3 100644 --- a/src/test/regress/expected/interval.out +++ b/src/test/regress/expected/interval.out @@ -39,6 +39,18 @@ SELECT INTERVAL '-1 days +02:03' AS "22 hours ago..."; -1 days +02:03:00 (1 row) +SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours"; + Ten days twelve hours +----------------------- + 10 days 12:00:00 +(1 row) + +SELECT INTERVAL '1.5 months' AS "One month 15 days"; + One month 15 days +------------------- + 1 mon 15 days +(1 row) + SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years..."; 9 years... ---------------------------------- diff --git a/src/test/regress/sql/interval.sql b/src/test/regress/sql/interval.sql index bc384d01212..f38b01e45dc 100644 --- a/src/test/regress/sql/interval.sql +++ b/src/test/regress/sql/interval.sql @@ -11,6 +11,8 @@ SELECT INTERVAL '-08:00' AS "Eight hours"; SELECT INTERVAL '-05' AS "Five hours"; SELECT INTERVAL '-1 +02:03' AS "22 hours ago..."; SELECT INTERVAL '-1 days +02:03' AS "22 hours ago..."; +SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours"; +SELECT INTERVAL '1.5 months' AS "One month 15 days"; SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years..."; CREATE TABLE INTERVAL_TBL (f1 interval); |
