Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8997675

Browse files
author
Thomas G. Lockhart
committed
All regression tests pass except for rules.sql (unrelated).
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.
1 parent41f1f5b commit8997675

File tree

11 files changed

+909
-1410
lines changed

11 files changed

+909
-1410
lines changed

‎src/test/regress/expected/horology.out

Lines changed: 470 additions & 930 deletions
Large diffs are not rendered by default.

‎src/test/regress/expected/timespan.outrenamed to‎src/test/regress/expected/interval.out

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
--
2-
--TIMESPAN
2+
--INTERVAL
33
--
4-
CREATE TABLETIMESPAN_TBL (f1timespan);
5-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('@ 1 minute');
6-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('@ 5 hour');
7-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('@ 10 day');
8-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('@ 34 year');
9-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('@ 3 months');
10-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('@ 14 seconds ago');
11-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
12-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('6 years');
13-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('5 months');
14-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('5 months 12 hours');
15-
-- badly formattedtimespan
16-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('badly formattedtimespan');
17-
ERROR: Badtimespan external representation 'badly formattedtimespan'
18-
INSERT INTOTIMESPAN_TBL (f1) VALUES ('@ 30 eons ago');
19-
ERROR: Badtimespan external representation '@ 30 eons ago'
20-
-- testtimespan operators
21-
SELECT '' AS ten,TIMESPAN_TBL.*;
4+
CREATE TABLEINTERVAL_TBL (f1interval);
5+
INSERT INTOINTERVAL_TBL (f1) VALUES ('@ 1 minute');
6+
INSERT INTOINTERVAL_TBL (f1) VALUES ('@ 5 hour');
7+
INSERT INTOINTERVAL_TBL (f1) VALUES ('@ 10 day');
8+
INSERT INTOINTERVAL_TBL (f1) VALUES ('@ 34 year');
9+
INSERT INTOINTERVAL_TBL (f1) VALUES ('@ 3 months');
10+
INSERT INTOINTERVAL_TBL (f1) VALUES ('@ 14 seconds ago');
11+
INSERT INTOINTERVAL_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
12+
INSERT INTOINTERVAL_TBL (f1) VALUES ('6 years');
13+
INSERT INTOINTERVAL_TBL (f1) VALUES ('5 months');
14+
INSERT INTOINTERVAL_TBL (f1) VALUES ('5 months 12 hours');
15+
-- badly formattedinterval
16+
INSERT INTOINTERVAL_TBL (f1) VALUES ('badly formattedinterval');
17+
ERROR: Badinterval external representation 'badly formattedinterval'
18+
INSERT INTOINTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
19+
ERROR: Badinterval external representation '@ 30 eons ago'
20+
-- testinterval operators
21+
SELECT '' AS ten,INTERVAL_TBL.*;
2222
ten | f1
2323
-----+-------------------------------
2424
| @ 1 min
@@ -33,8 +33,8 @@ SELECT '' AS ten, TIMESPAN_TBL.*;
3333
| @ 5 mons 12 hours
3434
(10 rows)
3535

36-
SELECT '' AS nine,TIMESPAN_TBL.*
37-
WHERETIMESPAN_TBL.f1 <>timespan '@ 10 days';
36+
SELECT '' AS nine,INTERVAL_TBL.*
37+
WHEREINTERVAL_TBL.f1 <>interval '@ 10 days';
3838
nine | f1
3939
------+-------------------------------
4040
| @ 1 min
@@ -48,33 +48,33 @@ SELECT '' AS nine, TIMESPAN_TBL.*
4848
| @ 5 mons 12 hours
4949
(9 rows)
5050

51-
SELECT '' AS three,TIMESPAN_TBL.*
52-
WHERETIMESPAN_TBL.f1 <=timespan '@ 5 hours';
51+
SELECT '' AS three,INTERVAL_TBL.*
52+
WHEREINTERVAL_TBL.f1 <=interval '@ 5 hours';
5353
three | f1
5454
-------+---------------
5555
| @ 1 min
5656
| @ 5 hours
5757
| @ 14 secs ago
5858
(3 rows)
5959

60-
SELECT '' AS three,TIMESPAN_TBL.*
61-
WHERETIMESPAN_TBL.f1 <timespan '@ 1 day';
60+
SELECT '' AS three,INTERVAL_TBL.*
61+
WHEREINTERVAL_TBL.f1 <interval '@ 1 day';
6262
three | f1
6363
-------+---------------
6464
| @ 1 min
6565
| @ 5 hours
6666
| @ 14 secs ago
6767
(3 rows)
6868

69-
SELECT '' AS one,TIMESPAN_TBL.*
70-
WHERETIMESPAN_TBL.f1 =timespan '@ 34 years';
69+
SELECT '' AS one,INTERVAL_TBL.*
70+
WHEREINTERVAL_TBL.f1 =interval '@ 34 years';
7171
one | f1
7272
-----+------------
7373
| @ 34 years
7474
(1 row)
7575

76-
SELECT '' AS five,TIMESPAN_TBL.*
77-
WHERETIMESPAN_TBL.f1 >=timespan '@ 1 month';
76+
SELECT '' AS five,INTERVAL_TBL.*
77+
WHEREINTERVAL_TBL.f1 >=interval '@ 1 month';
7878
five | f1
7979
------+-------------------
8080
| @ 34 years
@@ -84,8 +84,8 @@ SELECT '' AS five, TIMESPAN_TBL.*
8484
| @ 5 mons 12 hours
8585
(5 rows)
8686

87-
SELECT '' AS nine,TIMESPAN_TBL.*
88-
WHERETIMESPAN_TBL.f1 >timespan '@ 3 seconds ago';
87+
SELECT '' AS nine,INTERVAL_TBL.*
88+
WHEREINTERVAL_TBL.f1 >interval '@ 3 seconds ago';
8989
nine | f1
9090
------+-------------------------------
9191
| @ 1 min
@@ -100,7 +100,7 @@ SELECT '' AS nine, TIMESPAN_TBL.*
100100
(9 rows)
101101

102102
SELECT '' AS fortyfive, r1.*, r2.*
103-
FROMTIMESPAN_TBL r1,TIMESPAN_TBL r2
103+
FROMINTERVAL_TBL r1,INTERVAL_TBL r2
104104
WHERE r1.f1 > r2.f1
105105
ORDER BY r1.f1, r2.f1;
106106
fortyfive | f1 | f1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp