-
-
Notifications
You must be signed in to change notification settings - Fork 661
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Grammar: Add complete datetime units to postgres dialect (#2025)
- Loading branch information
Showing
3 changed files
with
544 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
test/fixtures/dialects/postgres/postgres_datetime_units.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
SELECT | ||
t1.field, | ||
EXTRACT(CENTURY FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(DECADE FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(DOW FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(DOY FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(EPOCH FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(ISODOW FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(ISOYEAR FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(MICROSECONDS FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(MILLENNIUM FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(MILLISECONDS FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(TIMEZONE FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(TIMEZONE_HOUR FROM t1.sometime) AS a | ||
FROM t1; | ||
|
||
SELECT | ||
t1.field, | ||
EXTRACT(TIMEZONE_MINUTE FROM t1.sometime) AS a | ||
FROM t1; |
Oops, something went wrong.