diff options
| author | Bruce Momjian | 2004-03-05 02:41:14 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2004-03-05 02:41:14 +0000 |
| commit | 1973971821672447d30bda6f12736a7e5987569f (patch) | |
| tree | 7c2ac97848f3cd1eb45442feceef2834c6b25581 /src/test | |
| parent | 44611f6e6d2cd11ac2c6dc1f41c13a98ec633f08 (diff) | |
Per a brief conversation with Tom, I've created a patch for adding
support for 'week' within the date_trunc function.
Within the patch I added a couple of test cases and associated target
output, and changed the documentation to add 'week' appropriately.
Robert Creager
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/timestamp.out | 6 | ||||
| -rw-r--r-- | src/test/regress/expected/timestamptz.out | 10 | ||||
| -rw-r--r-- | src/test/regress/sql/timestamp.sql | 2 | ||||
| -rw-r--r-- | src/test/regress/sql/timestamptz.sql | 2 |
4 files changed, 18 insertions, 2 deletions
diff --git a/src/test/regress/expected/timestamp.out b/src/test/regress/expected/timestamp.out index f037d576ec8..7557bf2900e 100644 --- a/src/test/regress/expected/timestamp.out +++ b/src/test/regress/expected/timestamp.out @@ -499,6 +499,12 @@ SELECT '' AS "54", d1 - timestamp without time zone '1997-01-02' AS diff | @ 1460 days 17 hours 32 mins 1 sec (54 rows) +SELECT '' AS date_trunc_week, date_trunc( 'week', timestamp '2004-02-29 15:44:17.71393' ) AS week_trunc; + date_trunc_week | week_trunc +-----------------+-------------------------- + | Mon Feb 23 00:00:00 2004 +(1 row) + -- Test casting within a BETWEEN qualifier SELECT '' AS "54", d1 - timestamp without time zone '1997-01-02' AS diff FROM TIMESTAMP_TBL diff --git a/src/test/regress/expected/timestamptz.out b/src/test/regress/expected/timestamptz.out index a76e09a0f54..8a9bccf0a34 100644 --- a/src/test/regress/expected/timestamptz.out +++ b/src/test/regress/expected/timestamptz.out @@ -494,6 +494,12 @@ SELECT '' AS "54", d1 - timestamp with time zone '1997-01-02' AS diff | @ 1460 days 17 hours 32 mins 1 sec (54 rows) +SELECT '' AS date_trunc_week, date_trunc( 'week', timestamp with time zone '2004-02-29 15:44:17.71393' ) AS week_trunc; + date_trunc_week | week_trunc +-----------------+------------------------------ + | Mon Feb 23 00:00:00 2004 PST +(1 row) + -- Test casting within a BETWEEN qualifier SELECT '' AS "54", d1 - timestamp with time zone '1997-01-02' AS diff FROM TIMESTAMPTZ_TBL @@ -1317,9 +1323,9 @@ SELECT '' AS to_char_9, to_char(d1, 'YYYY A.D. YYYY a.d. YYYY bc HH:MI:SS P.M. H | 2001 A.D. 2001 a.d. 2001 ad 05:32:01 P.M. 05:32:01 p.m. 05:32:01 pm (64 rows) -SELECT '' AS to_char_10, to_char(d1, 'YYYY WW IYYY IYY IY I IW') +SELECT '' AS to_char_10, to_char(d1, 'YYYY WW IYYY IYY IY I IW') FROM TIMESTAMPTZ_TBL; - to_char_10 | to_char + to_char_10 | to_char ------------+-------------------------- | | diff --git a/src/test/regress/sql/timestamp.sql b/src/test/regress/sql/timestamp.sql index 48a9151a703..ceda76f546a 100644 --- a/src/test/regress/sql/timestamp.sql +++ b/src/test/regress/sql/timestamp.sql @@ -151,6 +151,8 @@ SELECT '' AS "49", d1 FROM TIMESTAMP_TBL SELECT '' AS "54", d1 - timestamp without time zone '1997-01-02' AS diff FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01'; +SELECT '' AS date_trunc_week, date_trunc( 'week', timestamp '2004-02-29 15:44:17.71393' ) AS week_trunc; + -- Test casting within a BETWEEN qualifier SELECT '' AS "54", d1 - timestamp without time zone '1997-01-02' AS diff FROM TIMESTAMP_TBL diff --git a/src/test/regress/sql/timestamptz.sql b/src/test/regress/sql/timestamptz.sql index 2a789b87bd2..12572fa7ce4 100644 --- a/src/test/regress/sql/timestamptz.sql +++ b/src/test/regress/sql/timestamptz.sql @@ -145,6 +145,8 @@ SELECT '' AS "49", d1 FROM TIMESTAMPTZ_TBL SELECT '' AS "54", d1 - timestamp with time zone '1997-01-02' AS diff FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01'; +SELECT '' AS date_trunc_week, date_trunc( 'week', timestamp with time zone '2004-02-29 15:44:17.71393' ) AS week_trunc; + -- Test casting within a BETWEEN qualifier SELECT '' AS "54", d1 - timestamp with time zone '1997-01-02' AS diff FROM TIMESTAMPTZ_TBL |
