mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-08 14:49:23 +02:00
Remove redundant function calls in timestamp[tz]_part().
The DTK_DOW/DTK_ISODOW and DTK_DOY switch cases in timestamp_part() and
timestamptz_part() contained calls of timestamp2tm() that were fully
redundant with the ones done just above the switch. This evidently crept
in during commit 258ee1b63
, which relocated that code from another place
where the calls were indeed needed. Just delete the redundant calls.
I (tgl) noted that our test coverage of these functions left quite a
bit to be desired, so extend timestamp.sql and timestamptz.sql to
cover all the branches.
Back-patch to all supported branches, as the previous commit was.
There's no real issue here other than some wasted cycles in some
not-too-heavily-used code paths, but the test coverage seems valuable.
Report and patch by Li Japin; test case adjustments by me.
Discussion: https://postgr.es/m/SG2PR06MB37762CAE45DB0F6CA7001EA9B6550@SG2PR06MB3776.apcprd06.prod.outlook.com
This commit is contained in:
parent
d94766a65a
commit
7d233810a3
@ -4543,20 +4543,12 @@ timestamp_part(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
case DTK_DOW:
|
case DTK_DOW:
|
||||||
case DTK_ISODOW:
|
case DTK_ISODOW:
|
||||||
if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) != 0)
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
|
||||||
errmsg("timestamp out of range")));
|
|
||||||
result = j2day(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday));
|
result = j2day(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday));
|
||||||
if (val == DTK_ISODOW && result == 0)
|
if (val == DTK_ISODOW && result == 0)
|
||||||
result = 7;
|
result = 7;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DTK_DOY:
|
case DTK_DOY:
|
||||||
if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) != 0)
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
|
||||||
errmsg("timestamp out of range")));
|
|
||||||
result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)
|
result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)
|
||||||
- date2j(tm->tm_year, 1, 1) + 1);
|
- date2j(tm->tm_year, 1, 1) + 1);
|
||||||
break;
|
break;
|
||||||
@ -4747,20 +4739,12 @@ timestamptz_part(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
case DTK_DOW:
|
case DTK_DOW:
|
||||||
case DTK_ISODOW:
|
case DTK_ISODOW:
|
||||||
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
|
||||||
errmsg("timestamp out of range")));
|
|
||||||
result = j2day(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday));
|
result = j2day(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday));
|
||||||
if (val == DTK_ISODOW && result == 0)
|
if (val == DTK_ISODOW && result == 0)
|
||||||
result = 7;
|
result = 7;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DTK_DOY:
|
case DTK_DOY:
|
||||||
if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0)
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
|
||||||
errmsg("timestamp out of range")));
|
|
||||||
result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)
|
result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)
|
||||||
- date2j(tm->tm_year, 1, 1) + 1);
|
- date2j(tm->tm_year, 1, 1) + 1);
|
||||||
break;
|
break;
|
||||||
|
@ -625,195 +625,302 @@ SELECT '' AS "54", d1 - timestamp without time zone '1997-01-02' AS diff
|
|||||||
| @ 1460 days 17 hours 32 mins 1 sec
|
| @ 1460 days 17 hours 32 mins 1 sec
|
||||||
(55 rows)
|
(55 rows)
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as "timestamp",
|
-- DATE_PART (timestamp_part)
|
||||||
|
SELECT d1 as "timestamp",
|
||||||
date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
|
date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
|
||||||
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
|
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
|
||||||
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
|
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
|
||||||
FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
FROM TIMESTAMP_TBL;
|
||||||
54 | timestamp | year | month | day | hour | minute | second
|
timestamp | year | month | day | hour | minute | second
|
||||||
----+----------------------------+------+-------+-----+------+--------+--------
|
-----------------------------+-----------+-------+-----+------+--------+--------
|
||||||
| Thu Jan 01 00:00:00 1970 | 1970 | 1 | 1 | 0 | 0 | 0
|
-infinity | -Infinity | | | | |
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
infinity | Infinity | | | | |
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Thu Jan 01 00:00:00 1970 | 1970 | 1 | 1 | 0 | 0 | 0
|
||||||
| Mon Feb 10 17:32:02 1997 | 1997 | 2 | 10 | 17 | 32 | 2
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01.4 1997 | 1997 | 2 | 10 | 17 | 32 | 1.4
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01.5 1997 | 1997 | 2 | 10 | 17 | 32 | 1.5
|
Mon Feb 10 17:32:02 1997 | 1997 | 2 | 10 | 17 | 32 | 2
|
||||||
| Mon Feb 10 17:32:01.6 1997 | 1997 | 2 | 10 | 17 | 32 | 1.6
|
Mon Feb 10 17:32:01.4 1997 | 1997 | 2 | 10 | 17 | 32 | 1.4
|
||||||
| Thu Jan 02 00:00:00 1997 | 1997 | 1 | 2 | 0 | 0 | 0
|
Mon Feb 10 17:32:01.5 1997 | 1997 | 2 | 10 | 17 | 32 | 1.5
|
||||||
| Thu Jan 02 03:04:05 1997 | 1997 | 1 | 2 | 3 | 4 | 5
|
Mon Feb 10 17:32:01.6 1997 | 1997 | 2 | 10 | 17 | 32 | 1.6
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Thu Jan 02 00:00:00 1997 | 1997 | 1 | 2 | 0 | 0 | 0
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Thu Jan 02 03:04:05 1997 | 1997 | 1 | 2 | 3 | 4 | 5
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Tue Jun 10 17:32:01 1997 | 1997 | 6 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Sat Sep 22 18:19:20 2001 | 2001 | 9 | 22 | 18 | 19 | 20
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Wed Mar 15 08:14:01 2000 | 2000 | 3 | 15 | 8 | 14 | 1
|
Tue Jun 10 17:32:01 1997 | 1997 | 6 | 10 | 17 | 32 | 1
|
||||||
| Wed Mar 15 13:14:02 2000 | 2000 | 3 | 15 | 13 | 14 | 2
|
Sat Sep 22 18:19:20 2001 | 2001 | 9 | 22 | 18 | 19 | 20
|
||||||
| Wed Mar 15 12:14:03 2000 | 2000 | 3 | 15 | 12 | 14 | 3
|
Wed Mar 15 08:14:01 2000 | 2000 | 3 | 15 | 8 | 14 | 1
|
||||||
| Wed Mar 15 03:14:04 2000 | 2000 | 3 | 15 | 3 | 14 | 4
|
Wed Mar 15 13:14:02 2000 | 2000 | 3 | 15 | 13 | 14 | 2
|
||||||
| Wed Mar 15 02:14:05 2000 | 2000 | 3 | 15 | 2 | 14 | 5
|
Wed Mar 15 12:14:03 2000 | 2000 | 3 | 15 | 12 | 14 | 3
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Wed Mar 15 03:14:04 2000 | 2000 | 3 | 15 | 3 | 14 | 4
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Wed Mar 15 02:14:05 2000 | 2000 | 3 | 15 | 2 | 14 | 5
|
||||||
| Mon Feb 10 17:32:00 1997 | 1997 | 2 | 10 | 17 | 32 | 0
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:00 1997 | 1997 | 2 | 10 | 17 | 32 | 0
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Tue Jun 10 18:32:01 1997 | 1997 | 6 | 10 | 18 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Tue Feb 11 17:32:01 1997 | 1997 | 2 | 11 | 17 | 32 | 1
|
Tue Jun 10 18:32:01 1997 | 1997 | 6 | 10 | 18 | 32 | 1
|
||||||
| Wed Feb 12 17:32:01 1997 | 1997 | 2 | 12 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Thu Feb 13 17:32:01 1997 | 1997 | 2 | 13 | 17 | 32 | 1
|
Tue Feb 11 17:32:01 1997 | 1997 | 2 | 11 | 17 | 32 | 1
|
||||||
| Fri Feb 14 17:32:01 1997 | 1997 | 2 | 14 | 17 | 32 | 1
|
Wed Feb 12 17:32:01 1997 | 1997 | 2 | 12 | 17 | 32 | 1
|
||||||
| Sat Feb 15 17:32:01 1997 | 1997 | 2 | 15 | 17 | 32 | 1
|
Thu Feb 13 17:32:01 1997 | 1997 | 2 | 13 | 17 | 32 | 1
|
||||||
| Sun Feb 16 17:32:01 1997 | 1997 | 2 | 16 | 17 | 32 | 1
|
Fri Feb 14 17:32:01 1997 | 1997 | 2 | 14 | 17 | 32 | 1
|
||||||
| Sun Feb 16 17:32:01 1997 | 1997 | 2 | 16 | 17 | 32 | 1
|
Sat Feb 15 17:32:01 1997 | 1997 | 2 | 15 | 17 | 32 | 1
|
||||||
| Wed Feb 28 17:32:01 1996 | 1996 | 2 | 28 | 17 | 32 | 1
|
Sun Feb 16 17:32:01 1997 | 1997 | 2 | 16 | 17 | 32 | 1
|
||||||
| Thu Feb 29 17:32:01 1996 | 1996 | 2 | 29 | 17 | 32 | 1
|
Tue Feb 16 17:32:01 0097 BC | -97 | 2 | 16 | 17 | 32 | 1
|
||||||
| Fri Mar 01 17:32:01 1996 | 1996 | 3 | 1 | 17 | 32 | 1
|
Sat Feb 16 17:32:01 0097 | 97 | 2 | 16 | 17 | 32 | 1
|
||||||
| Mon Dec 30 17:32:01 1996 | 1996 | 12 | 30 | 17 | 32 | 1
|
Thu Feb 16 17:32:01 0597 | 597 | 2 | 16 | 17 | 32 | 1
|
||||||
| Tue Dec 31 17:32:01 1996 | 1996 | 12 | 31 | 17 | 32 | 1
|
Tue Feb 16 17:32:01 1097 | 1097 | 2 | 16 | 17 | 32 | 1
|
||||||
| Wed Jan 01 17:32:01 1997 | 1997 | 1 | 1 | 17 | 32 | 1
|
Sat Feb 16 17:32:01 1697 | 1697 | 2 | 16 | 17 | 32 | 1
|
||||||
| Fri Feb 28 17:32:01 1997 | 1997 | 2 | 28 | 17 | 32 | 1
|
Thu Feb 16 17:32:01 1797 | 1797 | 2 | 16 | 17 | 32 | 1
|
||||||
| Sat Mar 01 17:32:01 1997 | 1997 | 3 | 1 | 17 | 32 | 1
|
Tue Feb 16 17:32:01 1897 | 1897 | 2 | 16 | 17 | 32 | 1
|
||||||
| Tue Dec 30 17:32:01 1997 | 1997 | 12 | 30 | 17 | 32 | 1
|
Sun Feb 16 17:32:01 1997 | 1997 | 2 | 16 | 17 | 32 | 1
|
||||||
| Wed Dec 31 17:32:01 1997 | 1997 | 12 | 31 | 17 | 32 | 1
|
Sat Feb 16 17:32:01 2097 | 2097 | 2 | 16 | 17 | 32 | 1
|
||||||
| Fri Dec 31 17:32:01 1999 | 1999 | 12 | 31 | 17 | 32 | 1
|
Wed Feb 28 17:32:01 1996 | 1996 | 2 | 28 | 17 | 32 | 1
|
||||||
| Sat Jan 01 17:32:01 2000 | 2000 | 1 | 1 | 17 | 32 | 1
|
Thu Feb 29 17:32:01 1996 | 1996 | 2 | 29 | 17 | 32 | 1
|
||||||
| Sun Dec 31 17:32:01 2000 | 2000 | 12 | 31 | 17 | 32 | 1
|
Fri Mar 01 17:32:01 1996 | 1996 | 3 | 1 | 17 | 32 | 1
|
||||||
| Mon Jan 01 17:32:01 2001 | 2001 | 1 | 1 | 17 | 32 | 1
|
Mon Dec 30 17:32:01 1996 | 1996 | 12 | 30 | 17 | 32 | 1
|
||||||
(55 rows)
|
Tue Dec 31 17:32:01 1996 | 1996 | 12 | 31 | 17 | 32 | 1
|
||||||
|
Wed Jan 01 17:32:01 1997 | 1997 | 1 | 1 | 17 | 32 | 1
|
||||||
|
Fri Feb 28 17:32:01 1997 | 1997 | 2 | 28 | 17 | 32 | 1
|
||||||
|
Sat Mar 01 17:32:01 1997 | 1997 | 3 | 1 | 17 | 32 | 1
|
||||||
|
Tue Dec 30 17:32:01 1997 | 1997 | 12 | 30 | 17 | 32 | 1
|
||||||
|
Wed Dec 31 17:32:01 1997 | 1997 | 12 | 31 | 17 | 32 | 1
|
||||||
|
Fri Dec 31 17:32:01 1999 | 1999 | 12 | 31 | 17 | 32 | 1
|
||||||
|
Sat Jan 01 17:32:01 2000 | 2000 | 1 | 1 | 17 | 32 | 1
|
||||||
|
Sun Dec 31 17:32:01 2000 | 2000 | 12 | 31 | 17 | 32 | 1
|
||||||
|
Mon Jan 01 17:32:01 2001 | 2001 | 1 | 1 | 17 | 32 | 1
|
||||||
|
(65 rows)
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as "timestamp",
|
SELECT d1 as "timestamp",
|
||||||
date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
|
date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
|
||||||
date_part( 'usec', d1) AS usec
|
date_part( 'usec', d1) AS usec
|
||||||
FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
FROM TIMESTAMP_TBL;
|
||||||
54 | timestamp | quarter | msec | usec
|
timestamp | quarter | msec | usec
|
||||||
----+----------------------------+---------+-------+----------
|
-----------------------------+---------+-------+----------
|
||||||
| Thu Jan 01 00:00:00 1970 | 1 | 0 | 0
|
-infinity | | |
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
infinity | | |
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Thu Jan 01 00:00:00 1970 | 1 | 0 | 0
|
||||||
| Mon Feb 10 17:32:02 1997 | 1 | 2000 | 2000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01.4 1997 | 1 | 1400 | 1400000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01.5 1997 | 1 | 1500 | 1500000
|
Mon Feb 10 17:32:02 1997 | 1 | 2000 | 2000000
|
||||||
| Mon Feb 10 17:32:01.6 1997 | 1 | 1600 | 1600000
|
Mon Feb 10 17:32:01.4 1997 | 1 | 1400 | 1400000
|
||||||
| Thu Jan 02 00:00:00 1997 | 1 | 0 | 0
|
Mon Feb 10 17:32:01.5 1997 | 1 | 1500 | 1500000
|
||||||
| Thu Jan 02 03:04:05 1997 | 1 | 5000 | 5000000
|
Mon Feb 10 17:32:01.6 1997 | 1 | 1600 | 1600000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Thu Jan 02 00:00:00 1997 | 1 | 0 | 0
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Thu Jan 02 03:04:05 1997 | 1 | 5000 | 5000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Tue Jun 10 17:32:01 1997 | 2 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Sat Sep 22 18:19:20 2001 | 3 | 20000 | 20000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Wed Mar 15 08:14:01 2000 | 1 | 1000 | 1000000
|
Tue Jun 10 17:32:01 1997 | 2 | 1000 | 1000000
|
||||||
| Wed Mar 15 13:14:02 2000 | 1 | 2000 | 2000000
|
Sat Sep 22 18:19:20 2001 | 3 | 20000 | 20000000
|
||||||
| Wed Mar 15 12:14:03 2000 | 1 | 3000 | 3000000
|
Wed Mar 15 08:14:01 2000 | 1 | 1000 | 1000000
|
||||||
| Wed Mar 15 03:14:04 2000 | 1 | 4000 | 4000000
|
Wed Mar 15 13:14:02 2000 | 1 | 2000 | 2000000
|
||||||
| Wed Mar 15 02:14:05 2000 | 1 | 5000 | 5000000
|
Wed Mar 15 12:14:03 2000 | 1 | 3000 | 3000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Wed Mar 15 03:14:04 2000 | 1 | 4000 | 4000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Wed Mar 15 02:14:05 2000 | 1 | 5000 | 5000000
|
||||||
| Mon Feb 10 17:32:00 1997 | 1 | 0 | 0
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:00 1997 | 1 | 0 | 0
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Tue Jun 10 18:32:01 1997 | 2 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Tue Feb 11 17:32:01 1997 | 1 | 1000 | 1000000
|
Tue Jun 10 18:32:01 1997 | 2 | 1000 | 1000000
|
||||||
| Wed Feb 12 17:32:01 1997 | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Thu Feb 13 17:32:01 1997 | 1 | 1000 | 1000000
|
Tue Feb 11 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Fri Feb 14 17:32:01 1997 | 1 | 1000 | 1000000
|
Wed Feb 12 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Sat Feb 15 17:32:01 1997 | 1 | 1000 | 1000000
|
Thu Feb 13 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Sun Feb 16 17:32:01 1997 | 1 | 1000 | 1000000
|
Fri Feb 14 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Sun Feb 16 17:32:01 1997 | 1 | 1000 | 1000000
|
Sat Feb 15 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Wed Feb 28 17:32:01 1996 | 1 | 1000 | 1000000
|
Sun Feb 16 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Thu Feb 29 17:32:01 1996 | 1 | 1000 | 1000000
|
Tue Feb 16 17:32:01 0097 BC | 1 | 1000 | 1000000
|
||||||
| Fri Mar 01 17:32:01 1996 | 1 | 1000 | 1000000
|
Sat Feb 16 17:32:01 0097 | 1 | 1000 | 1000000
|
||||||
| Mon Dec 30 17:32:01 1996 | 4 | 1000 | 1000000
|
Thu Feb 16 17:32:01 0597 | 1 | 1000 | 1000000
|
||||||
| Tue Dec 31 17:32:01 1996 | 4 | 1000 | 1000000
|
Tue Feb 16 17:32:01 1097 | 1 | 1000 | 1000000
|
||||||
| Wed Jan 01 17:32:01 1997 | 1 | 1000 | 1000000
|
Sat Feb 16 17:32:01 1697 | 1 | 1000 | 1000000
|
||||||
| Fri Feb 28 17:32:01 1997 | 1 | 1000 | 1000000
|
Thu Feb 16 17:32:01 1797 | 1 | 1000 | 1000000
|
||||||
| Sat Mar 01 17:32:01 1997 | 1 | 1000 | 1000000
|
Tue Feb 16 17:32:01 1897 | 1 | 1000 | 1000000
|
||||||
| Tue Dec 30 17:32:01 1997 | 4 | 1000 | 1000000
|
Sun Feb 16 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
| Wed Dec 31 17:32:01 1997 | 4 | 1000 | 1000000
|
Sat Feb 16 17:32:01 2097 | 1 | 1000 | 1000000
|
||||||
| Fri Dec 31 17:32:01 1999 | 4 | 1000 | 1000000
|
Wed Feb 28 17:32:01 1996 | 1 | 1000 | 1000000
|
||||||
| Sat Jan 01 17:32:01 2000 | 1 | 1000 | 1000000
|
Thu Feb 29 17:32:01 1996 | 1 | 1000 | 1000000
|
||||||
| Sun Dec 31 17:32:01 2000 | 4 | 1000 | 1000000
|
Fri Mar 01 17:32:01 1996 | 1 | 1000 | 1000000
|
||||||
| Mon Jan 01 17:32:01 2001 | 1 | 1000 | 1000000
|
Mon Dec 30 17:32:01 1996 | 4 | 1000 | 1000000
|
||||||
(55 rows)
|
Tue Dec 31 17:32:01 1996 | 4 | 1000 | 1000000
|
||||||
|
Wed Jan 01 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
|
Fri Feb 28 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
|
Sat Mar 01 17:32:01 1997 | 1 | 1000 | 1000000
|
||||||
|
Tue Dec 30 17:32:01 1997 | 4 | 1000 | 1000000
|
||||||
|
Wed Dec 31 17:32:01 1997 | 4 | 1000 | 1000000
|
||||||
|
Fri Dec 31 17:32:01 1999 | 4 | 1000 | 1000000
|
||||||
|
Sat Jan 01 17:32:01 2000 | 1 | 1000 | 1000000
|
||||||
|
Sun Dec 31 17:32:01 2000 | 4 | 1000 | 1000000
|
||||||
|
Mon Jan 01 17:32:01 2001 | 1 | 1000 | 1000000
|
||||||
|
(65 rows)
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as "timestamp",
|
SELECT d1 as "timestamp",
|
||||||
date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
|
date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
|
||||||
date_part( 'dow', d1) AS dow
|
date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
|
||||||
FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
date_part( 'doy', d1) AS doy
|
||||||
54 | timestamp | isoyear | week | dow
|
FROM TIMESTAMP_TBL;
|
||||||
----+----------------------------+---------+------+-----
|
timestamp | isoyear | week | isodow | dow | doy
|
||||||
| Thu Jan 01 00:00:00 1970 | 1970 | 1 | 4
|
-----------------------------+-----------+------+--------+-----+-----
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
-infinity | -Infinity | | | |
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
infinity | Infinity | | | |
|
||||||
| Mon Feb 10 17:32:02 1997 | 1997 | 7 | 1
|
Thu Jan 01 00:00:00 1970 | 1970 | 1 | 4 | 4 | 1
|
||||||
| Mon Feb 10 17:32:01.4 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01.5 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01.6 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:02 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Thu Jan 02 00:00:00 1997 | 1997 | 1 | 4
|
Mon Feb 10 17:32:01.4 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Thu Jan 02 03:04:05 1997 | 1997 | 1 | 4
|
Mon Feb 10 17:32:01.5 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01.6 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Thu Jan 02 00:00:00 1997 | 1997 | 1 | 4 | 4 | 2
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Thu Jan 02 03:04:05 1997 | 1997 | 1 | 4 | 4 | 2
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Tue Jun 10 17:32:01 1997 | 1997 | 24 | 2
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Sat Sep 22 18:19:20 2001 | 2001 | 38 | 6
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Wed Mar 15 08:14:01 2000 | 2000 | 11 | 3
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Wed Mar 15 13:14:02 2000 | 2000 | 11 | 3
|
Tue Jun 10 17:32:01 1997 | 1997 | 24 | 2 | 2 | 161
|
||||||
| Wed Mar 15 12:14:03 2000 | 2000 | 11 | 3
|
Sat Sep 22 18:19:20 2001 | 2001 | 38 | 6 | 6 | 265
|
||||||
| Wed Mar 15 03:14:04 2000 | 2000 | 11 | 3
|
Wed Mar 15 08:14:01 2000 | 2000 | 11 | 3 | 3 | 75
|
||||||
| Wed Mar 15 02:14:05 2000 | 2000 | 11 | 3
|
Wed Mar 15 13:14:02 2000 | 2000 | 11 | 3 | 3 | 75
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Wed Mar 15 12:14:03 2000 | 2000 | 11 | 3 | 3 | 75
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Wed Mar 15 03:14:04 2000 | 2000 | 11 | 3 | 3 | 75
|
||||||
| Mon Feb 10 17:32:00 1997 | 1997 | 7 | 1
|
Wed Mar 15 02:14:05 2000 | 2000 | 11 | 3 | 3 | 75
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:00 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Tue Jun 10 18:32:01 1997 | 1997 | 24 | 2
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Tue Feb 11 17:32:01 1997 | 1997 | 7 | 2
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Wed Feb 12 17:32:01 1997 | 1997 | 7 | 3
|
Tue Jun 10 18:32:01 1997 | 1997 | 24 | 2 | 2 | 161
|
||||||
| Thu Feb 13 17:32:01 1997 | 1997 | 7 | 4
|
Mon Feb 10 17:32:01 1997 | 1997 | 7 | 1 | 1 | 41
|
||||||
| Fri Feb 14 17:32:01 1997 | 1997 | 7 | 5
|
Tue Feb 11 17:32:01 1997 | 1997 | 7 | 2 | 2 | 42
|
||||||
| Sat Feb 15 17:32:01 1997 | 1997 | 7 | 6
|
Wed Feb 12 17:32:01 1997 | 1997 | 7 | 3 | 3 | 43
|
||||||
| Sun Feb 16 17:32:01 1997 | 1997 | 7 | 0
|
Thu Feb 13 17:32:01 1997 | 1997 | 7 | 4 | 4 | 44
|
||||||
| Sun Feb 16 17:32:01 1997 | 1997 | 7 | 0
|
Fri Feb 14 17:32:01 1997 | 1997 | 7 | 5 | 5 | 45
|
||||||
| Wed Feb 28 17:32:01 1996 | 1996 | 9 | 3
|
Sat Feb 15 17:32:01 1997 | 1997 | 7 | 6 | 6 | 46
|
||||||
| Thu Feb 29 17:32:01 1996 | 1996 | 9 | 4
|
Sun Feb 16 17:32:01 1997 | 1997 | 7 | 7 | 0 | 47
|
||||||
| Fri Mar 01 17:32:01 1996 | 1996 | 9 | 5
|
Tue Feb 16 17:32:01 0097 BC | -96 | 7 | 2 | 2 | 47
|
||||||
| Mon Dec 30 17:32:01 1996 | 1997 | 1 | 1
|
Sat Feb 16 17:32:01 0097 | 97 | 7 | 6 | 6 | 47
|
||||||
| Tue Dec 31 17:32:01 1996 | 1997 | 1 | 2
|
Thu Feb 16 17:32:01 0597 | 597 | 7 | 4 | 4 | 47
|
||||||
| Wed Jan 01 17:32:01 1997 | 1997 | 1 | 3
|
Tue Feb 16 17:32:01 1097 | 1097 | 7 | 2 | 2 | 47
|
||||||
| Fri Feb 28 17:32:01 1997 | 1997 | 9 | 5
|
Sat Feb 16 17:32:01 1697 | 1697 | 7 | 6 | 6 | 47
|
||||||
| Sat Mar 01 17:32:01 1997 | 1997 | 9 | 6
|
Thu Feb 16 17:32:01 1797 | 1797 | 7 | 4 | 4 | 47
|
||||||
| Tue Dec 30 17:32:01 1997 | 1998 | 1 | 2
|
Tue Feb 16 17:32:01 1897 | 1897 | 7 | 2 | 2 | 47
|
||||||
| Wed Dec 31 17:32:01 1997 | 1998 | 1 | 3
|
Sun Feb 16 17:32:01 1997 | 1997 | 7 | 7 | 0 | 47
|
||||||
| Fri Dec 31 17:32:01 1999 | 1999 | 52 | 5
|
Sat Feb 16 17:32:01 2097 | 2097 | 7 | 6 | 6 | 47
|
||||||
| Sat Jan 01 17:32:01 2000 | 1999 | 52 | 6
|
Wed Feb 28 17:32:01 1996 | 1996 | 9 | 3 | 3 | 59
|
||||||
| Sun Dec 31 17:32:01 2000 | 2000 | 52 | 0
|
Thu Feb 29 17:32:01 1996 | 1996 | 9 | 4 | 4 | 60
|
||||||
| Mon Jan 01 17:32:01 2001 | 2001 | 1 | 1
|
Fri Mar 01 17:32:01 1996 | 1996 | 9 | 5 | 5 | 61
|
||||||
(55 rows)
|
Mon Dec 30 17:32:01 1996 | 1997 | 1 | 1 | 1 | 365
|
||||||
|
Tue Dec 31 17:32:01 1996 | 1997 | 1 | 2 | 2 | 366
|
||||||
|
Wed Jan 01 17:32:01 1997 | 1997 | 1 | 3 | 3 | 1
|
||||||
|
Fri Feb 28 17:32:01 1997 | 1997 | 9 | 5 | 5 | 59
|
||||||
|
Sat Mar 01 17:32:01 1997 | 1997 | 9 | 6 | 6 | 60
|
||||||
|
Tue Dec 30 17:32:01 1997 | 1998 | 1 | 2 | 2 | 364
|
||||||
|
Wed Dec 31 17:32:01 1997 | 1998 | 1 | 3 | 3 | 365
|
||||||
|
Fri Dec 31 17:32:01 1999 | 1999 | 52 | 5 | 5 | 365
|
||||||
|
Sat Jan 01 17:32:01 2000 | 1999 | 52 | 6 | 6 | 1
|
||||||
|
Sun Dec 31 17:32:01 2000 | 2000 | 52 | 7 | 0 | 366
|
||||||
|
Mon Jan 01 17:32:01 2001 | 2001 | 1 | 1 | 1 | 1
|
||||||
|
(65 rows)
|
||||||
|
|
||||||
|
SELECT d1 as "timestamp",
|
||||||
|
date_part( 'decade', d1) AS decade,
|
||||||
|
date_part( 'century', d1) AS century,
|
||||||
|
date_part( 'millennium', d1) AS millennium,
|
||||||
|
round(date_part( 'julian', d1)) AS julian
|
||||||
|
FROM TIMESTAMP_TBL;
|
||||||
|
timestamp | decade | century | millennium | julian
|
||||||
|
-----------------------------+-----------+-----------+------------+-----------
|
||||||
|
-infinity | -Infinity | -Infinity | -Infinity | -Infinity
|
||||||
|
infinity | Infinity | Infinity | Infinity | Infinity
|
||||||
|
Thu Jan 01 00:00:00 1970 | 197 | 20 | 2 | 2440588
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:02 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01.4 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01.5 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01.6 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Thu Jan 02 00:00:00 1997 | 199 | 20 | 2 | 2450451
|
||||||
|
Thu Jan 02 03:04:05 1997 | 199 | 20 | 2 | 2450451
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Tue Jun 10 17:32:01 1997 | 199 | 20 | 2 | 2450611
|
||||||
|
Sat Sep 22 18:19:20 2001 | 200 | 21 | 3 | 2452176
|
||||||
|
Wed Mar 15 08:14:01 2000 | 200 | 20 | 2 | 2451619
|
||||||
|
Wed Mar 15 13:14:02 2000 | 200 | 20 | 2 | 2451620
|
||||||
|
Wed Mar 15 12:14:03 2000 | 200 | 20 | 2 | 2451620
|
||||||
|
Wed Mar 15 03:14:04 2000 | 200 | 20 | 2 | 2451619
|
||||||
|
Wed Mar 15 02:14:05 2000 | 200 | 20 | 2 | 2451619
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:00 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Tue Jun 10 18:32:01 1997 | 199 | 20 | 2 | 2450611
|
||||||
|
Mon Feb 10 17:32:01 1997 | 199 | 20 | 2 | 2450491
|
||||||
|
Tue Feb 11 17:32:01 1997 | 199 | 20 | 2 | 2450492
|
||||||
|
Wed Feb 12 17:32:01 1997 | 199 | 20 | 2 | 2450493
|
||||||
|
Thu Feb 13 17:32:01 1997 | 199 | 20 | 2 | 2450494
|
||||||
|
Fri Feb 14 17:32:01 1997 | 199 | 20 | 2 | 2450495
|
||||||
|
Sat Feb 15 17:32:01 1997 | 199 | 20 | 2 | 2450496
|
||||||
|
Sun Feb 16 17:32:01 1997 | 199 | 20 | 2 | 2450497
|
||||||
|
Tue Feb 16 17:32:01 0097 BC | -10 | -1 | -1 | 1686043
|
||||||
|
Sat Feb 16 17:32:01 0097 | 9 | 1 | 1 | 1756537
|
||||||
|
Thu Feb 16 17:32:01 0597 | 59 | 6 | 1 | 1939158
|
||||||
|
Tue Feb 16 17:32:01 1097 | 109 | 11 | 2 | 2121779
|
||||||
|
Sat Feb 16 17:32:01 1697 | 169 | 17 | 2 | 2340925
|
||||||
|
Thu Feb 16 17:32:01 1797 | 179 | 18 | 2 | 2377449
|
||||||
|
Tue Feb 16 17:32:01 1897 | 189 | 19 | 2 | 2413973
|
||||||
|
Sun Feb 16 17:32:01 1997 | 199 | 20 | 2 | 2450497
|
||||||
|
Sat Feb 16 17:32:01 2097 | 209 | 21 | 3 | 2487022
|
||||||
|
Wed Feb 28 17:32:01 1996 | 199 | 20 | 2 | 2450143
|
||||||
|
Thu Feb 29 17:32:01 1996 | 199 | 20 | 2 | 2450144
|
||||||
|
Fri Mar 01 17:32:01 1996 | 199 | 20 | 2 | 2450145
|
||||||
|
Mon Dec 30 17:32:01 1996 | 199 | 20 | 2 | 2450449
|
||||||
|
Tue Dec 31 17:32:01 1996 | 199 | 20 | 2 | 2450450
|
||||||
|
Wed Jan 01 17:32:01 1997 | 199 | 20 | 2 | 2450451
|
||||||
|
Fri Feb 28 17:32:01 1997 | 199 | 20 | 2 | 2450509
|
||||||
|
Sat Mar 01 17:32:01 1997 | 199 | 20 | 2 | 2450510
|
||||||
|
Tue Dec 30 17:32:01 1997 | 199 | 20 | 2 | 2450814
|
||||||
|
Wed Dec 31 17:32:01 1997 | 199 | 20 | 2 | 2450815
|
||||||
|
Fri Dec 31 17:32:01 1999 | 199 | 20 | 2 | 2451545
|
||||||
|
Sat Jan 01 17:32:01 2000 | 200 | 20 | 2 | 2451546
|
||||||
|
Sun Dec 31 17:32:01 2000 | 200 | 20 | 2 | 2451911
|
||||||
|
Mon Jan 01 17:32:01 2001 | 200 | 21 | 3 | 2451912
|
||||||
|
(65 rows)
|
||||||
|
|
||||||
-- TO_CHAR()
|
-- TO_CHAR()
|
||||||
SELECT '' AS to_char_1, to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
SELECT '' AS to_char_1, to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||||
|
@ -713,198 +713,381 @@ SELECT '' AS "54", d1 - timestamp with time zone '1997-01-02' AS diff
|
|||||||
| @ 1460 days 17 hours 32 mins 1 sec
|
| @ 1460 days 17 hours 32 mins 1 sec
|
||||||
(56 rows)
|
(56 rows)
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as timestamptz,
|
-- DATE_PART (timestamptz_part)
|
||||||
|
SELECT d1 as timestamptz,
|
||||||
date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
|
date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
|
||||||
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
|
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
|
||||||
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
|
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
|
||||||
FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
FROM TIMESTAMPTZ_TBL;
|
||||||
54 | timestamptz | year | month | day | hour | minute | second
|
timestamptz | year | month | day | hour | minute | second
|
||||||
----+--------------------------------+------+-------+-----+------+--------+--------
|
---------------------------------+-----------+-------+-----+------+--------+--------
|
||||||
| Wed Dec 31 16:00:00 1969 PST | 1969 | 12 | 31 | 16 | 0 | 0
|
-infinity | -Infinity | | | | |
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
infinity | Infinity | | | | |
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Wed Dec 31 16:00:00 1969 PST | 1969 | 12 | 31 | 16 | 0 | 0
|
||||||
| Mon Feb 10 17:32:02 1997 PST | 1997 | 2 | 10 | 17 | 32 | 2
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01.4 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.4
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01.5 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.5
|
Mon Feb 10 17:32:02 1997 PST | 1997 | 2 | 10 | 17 | 32 | 2
|
||||||
| Mon Feb 10 17:32:01.6 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.6
|
Mon Feb 10 17:32:01.4 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.4
|
||||||
| Thu Jan 02 00:00:00 1997 PST | 1997 | 1 | 2 | 0 | 0 | 0
|
Mon Feb 10 17:32:01.5 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.5
|
||||||
| Thu Jan 02 03:04:05 1997 PST | 1997 | 1 | 2 | 3 | 4 | 5
|
Mon Feb 10 17:32:01.6 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1.6
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Thu Jan 02 00:00:00 1997 PST | 1997 | 1 | 2 | 0 | 0 | 0
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Thu Jan 02 03:04:05 1997 PST | 1997 | 1 | 2 | 3 | 4 | 5
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Tue Jun 10 17:32:01 1997 PDT | 1997 | 6 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Sat Sep 22 18:19:20 2001 PDT | 2001 | 9 | 22 | 18 | 19 | 20
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Wed Mar 15 08:14:01 2000 PST | 2000 | 3 | 15 | 8 | 14 | 1
|
Tue Jun 10 17:32:01 1997 PDT | 1997 | 6 | 10 | 17 | 32 | 1
|
||||||
| Wed Mar 15 04:14:02 2000 PST | 2000 | 3 | 15 | 4 | 14 | 2
|
Sat Sep 22 18:19:20 2001 PDT | 2001 | 9 | 22 | 18 | 19 | 20
|
||||||
| Wed Mar 15 02:14:03 2000 PST | 2000 | 3 | 15 | 2 | 14 | 3
|
Wed Mar 15 08:14:01 2000 PST | 2000 | 3 | 15 | 8 | 14 | 1
|
||||||
| Wed Mar 15 03:14:04 2000 PST | 2000 | 3 | 15 | 3 | 14 | 4
|
Wed Mar 15 04:14:02 2000 PST | 2000 | 3 | 15 | 4 | 14 | 2
|
||||||
| Wed Mar 15 01:14:05 2000 PST | 2000 | 3 | 15 | 1 | 14 | 5
|
Wed Mar 15 02:14:03 2000 PST | 2000 | 3 | 15 | 2 | 14 | 3
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Wed Mar 15 03:14:04 2000 PST | 2000 | 3 | 15 | 3 | 14 | 4
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Wed Mar 15 01:14:05 2000 PST | 2000 | 3 | 15 | 1 | 14 | 5
|
||||||
| Mon Feb 10 17:32:00 1997 PST | 1997 | 2 | 10 | 17 | 32 | 0
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:00 1997 PST | 1997 | 2 | 10 | 17 | 32 | 0
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
|
Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
|
||||||
| Mon Feb 10 14:32:01 1997 PST | 1997 | 2 | 10 | 14 | 32 | 1
|
Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
|
||||||
| Thu Jul 10 14:32:01 1997 PDT | 1997 | 7 | 10 | 14 | 32 | 1
|
Mon Feb 10 09:32:01 1997 PST | 1997 | 2 | 10 | 9 | 32 | 1
|
||||||
| Tue Jun 10 18:32:01 1997 PDT | 1997 | 6 | 10 | 18 | 32 | 1
|
Mon Feb 10 14:32:01 1997 PST | 1997 | 2 | 10 | 14 | 32 | 1
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
Thu Jul 10 14:32:01 1997 PDT | 1997 | 7 | 10 | 14 | 32 | 1
|
||||||
| Tue Feb 11 17:32:01 1997 PST | 1997 | 2 | 11 | 17 | 32 | 1
|
Tue Jun 10 18:32:01 1997 PDT | 1997 | 6 | 10 | 18 | 32 | 1
|
||||||
| Wed Feb 12 17:32:01 1997 PST | 1997 | 2 | 12 | 17 | 32 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 2 | 10 | 17 | 32 | 1
|
||||||
| Thu Feb 13 17:32:01 1997 PST | 1997 | 2 | 13 | 17 | 32 | 1
|
Tue Feb 11 17:32:01 1997 PST | 1997 | 2 | 11 | 17 | 32 | 1
|
||||||
| Fri Feb 14 17:32:01 1997 PST | 1997 | 2 | 14 | 17 | 32 | 1
|
Wed Feb 12 17:32:01 1997 PST | 1997 | 2 | 12 | 17 | 32 | 1
|
||||||
| Sat Feb 15 17:32:01 1997 PST | 1997 | 2 | 15 | 17 | 32 | 1
|
Thu Feb 13 17:32:01 1997 PST | 1997 | 2 | 13 | 17 | 32 | 1
|
||||||
| Sun Feb 16 17:32:01 1997 PST | 1997 | 2 | 16 | 17 | 32 | 1
|
Fri Feb 14 17:32:01 1997 PST | 1997 | 2 | 14 | 17 | 32 | 1
|
||||||
| Sun Feb 16 17:32:01 1997 PST | 1997 | 2 | 16 | 17 | 32 | 1
|
Sat Feb 15 17:32:01 1997 PST | 1997 | 2 | 15 | 17 | 32 | 1
|
||||||
| Wed Feb 28 17:32:01 1996 PST | 1996 | 2 | 28 | 17 | 32 | 1
|
Sun Feb 16 17:32:01 1997 PST | 1997 | 2 | 16 | 17 | 32 | 1
|
||||||
| Thu Feb 29 17:32:01 1996 PST | 1996 | 2 | 29 | 17 | 32 | 1
|
Tue Feb 16 17:32:01 0097 PST BC | -97 | 2 | 16 | 17 | 32 | 1
|
||||||
| Fri Mar 01 17:32:01 1996 PST | 1996 | 3 | 1 | 17 | 32 | 1
|
Sat Feb 16 17:32:01 0097 PST | 97 | 2 | 16 | 17 | 32 | 1
|
||||||
| Mon Dec 30 17:32:01 1996 PST | 1996 | 12 | 30 | 17 | 32 | 1
|
Thu Feb 16 17:32:01 0597 PST | 597 | 2 | 16 | 17 | 32 | 1
|
||||||
| Tue Dec 31 17:32:01 1996 PST | 1996 | 12 | 31 | 17 | 32 | 1
|
Tue Feb 16 17:32:01 1097 PST | 1097 | 2 | 16 | 17 | 32 | 1
|
||||||
| Wed Jan 01 17:32:01 1997 PST | 1997 | 1 | 1 | 17 | 32 | 1
|
Sat Feb 16 17:32:01 1697 PST | 1697 | 2 | 16 | 17 | 32 | 1
|
||||||
| Fri Feb 28 17:32:01 1997 PST | 1997 | 2 | 28 | 17 | 32 | 1
|
Thu Feb 16 17:32:01 1797 PST | 1797 | 2 | 16 | 17 | 32 | 1
|
||||||
| Sat Mar 01 17:32:01 1997 PST | 1997 | 3 | 1 | 17 | 32 | 1
|
Tue Feb 16 17:32:01 1897 PST | 1897 | 2 | 16 | 17 | 32 | 1
|
||||||
| Tue Dec 30 17:32:01 1997 PST | 1997 | 12 | 30 | 17 | 32 | 1
|
Sun Feb 16 17:32:01 1997 PST | 1997 | 2 | 16 | 17 | 32 | 1
|
||||||
| Wed Dec 31 17:32:01 1997 PST | 1997 | 12 | 31 | 17 | 32 | 1
|
Sat Feb 16 17:32:01 2097 PST | 2097 | 2 | 16 | 17 | 32 | 1
|
||||||
| Fri Dec 31 17:32:01 1999 PST | 1999 | 12 | 31 | 17 | 32 | 1
|
Wed Feb 28 17:32:01 1996 PST | 1996 | 2 | 28 | 17 | 32 | 1
|
||||||
| Sat Jan 01 17:32:01 2000 PST | 2000 | 1 | 1 | 17 | 32 | 1
|
Thu Feb 29 17:32:01 1996 PST | 1996 | 2 | 29 | 17 | 32 | 1
|
||||||
| Sun Dec 31 17:32:01 2000 PST | 2000 | 12 | 31 | 17 | 32 | 1
|
Fri Mar 01 17:32:01 1996 PST | 1996 | 3 | 1 | 17 | 32 | 1
|
||||||
| Mon Jan 01 17:32:01 2001 PST | 2001 | 1 | 1 | 17 | 32 | 1
|
Mon Dec 30 17:32:01 1996 PST | 1996 | 12 | 30 | 17 | 32 | 1
|
||||||
(56 rows)
|
Tue Dec 31 17:32:01 1996 PST | 1996 | 12 | 31 | 17 | 32 | 1
|
||||||
|
Wed Jan 01 17:32:01 1997 PST | 1997 | 1 | 1 | 17 | 32 | 1
|
||||||
|
Fri Feb 28 17:32:01 1997 PST | 1997 | 2 | 28 | 17 | 32 | 1
|
||||||
|
Sat Mar 01 17:32:01 1997 PST | 1997 | 3 | 1 | 17 | 32 | 1
|
||||||
|
Tue Dec 30 17:32:01 1997 PST | 1997 | 12 | 30 | 17 | 32 | 1
|
||||||
|
Wed Dec 31 17:32:01 1997 PST | 1997 | 12 | 31 | 17 | 32 | 1
|
||||||
|
Fri Dec 31 17:32:01 1999 PST | 1999 | 12 | 31 | 17 | 32 | 1
|
||||||
|
Sat Jan 01 17:32:01 2000 PST | 2000 | 1 | 1 | 17 | 32 | 1
|
||||||
|
Sun Dec 31 17:32:01 2000 PST | 2000 | 12 | 31 | 17 | 32 | 1
|
||||||
|
Mon Jan 01 17:32:01 2001 PST | 2001 | 1 | 1 | 17 | 32 | 1
|
||||||
|
(66 rows)
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as timestamptz,
|
SELECT d1 as timestamptz,
|
||||||
date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
|
date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
|
||||||
date_part( 'usec', d1) AS usec
|
date_part( 'usec', d1) AS usec
|
||||||
FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
FROM TIMESTAMPTZ_TBL;
|
||||||
54 | timestamptz | quarter | msec | usec
|
timestamptz | quarter | msec | usec
|
||||||
----+--------------------------------+---------+-------+----------
|
---------------------------------+---------+-------+----------
|
||||||
| Wed Dec 31 16:00:00 1969 PST | 4 | 0 | 0
|
-infinity | | |
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
infinity | | |
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Wed Dec 31 16:00:00 1969 PST | 4 | 0 | 0
|
||||||
| Mon Feb 10 17:32:02 1997 PST | 1 | 2000 | 2000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01.4 1997 PST | 1 | 1400 | 1400000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01.5 1997 PST | 1 | 1500 | 1500000
|
Mon Feb 10 17:32:02 1997 PST | 1 | 2000 | 2000000
|
||||||
| Mon Feb 10 17:32:01.6 1997 PST | 1 | 1600 | 1600000
|
Mon Feb 10 17:32:01.4 1997 PST | 1 | 1400 | 1400000
|
||||||
| Thu Jan 02 00:00:00 1997 PST | 1 | 0 | 0
|
Mon Feb 10 17:32:01.5 1997 PST | 1 | 1500 | 1500000
|
||||||
| Thu Jan 02 03:04:05 1997 PST | 1 | 5000 | 5000000
|
Mon Feb 10 17:32:01.6 1997 PST | 1 | 1600 | 1600000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Thu Jan 02 00:00:00 1997 PST | 1 | 0 | 0
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Thu Jan 02 03:04:05 1997 PST | 1 | 5000 | 5000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Tue Jun 10 17:32:01 1997 PDT | 2 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Sat Sep 22 18:19:20 2001 PDT | 3 | 20000 | 20000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Wed Mar 15 08:14:01 2000 PST | 1 | 1000 | 1000000
|
Tue Jun 10 17:32:01 1997 PDT | 2 | 1000 | 1000000
|
||||||
| Wed Mar 15 04:14:02 2000 PST | 1 | 2000 | 2000000
|
Sat Sep 22 18:19:20 2001 PDT | 3 | 20000 | 20000000
|
||||||
| Wed Mar 15 02:14:03 2000 PST | 1 | 3000 | 3000000
|
Wed Mar 15 08:14:01 2000 PST | 1 | 1000 | 1000000
|
||||||
| Wed Mar 15 03:14:04 2000 PST | 1 | 4000 | 4000000
|
Wed Mar 15 04:14:02 2000 PST | 1 | 2000 | 2000000
|
||||||
| Wed Mar 15 01:14:05 2000 PST | 1 | 5000 | 5000000
|
Wed Mar 15 02:14:03 2000 PST | 1 | 3000 | 3000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Wed Mar 15 03:14:04 2000 PST | 1 | 4000 | 4000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Wed Mar 15 01:14:05 2000 PST | 1 | 5000 | 5000000
|
||||||
| Mon Feb 10 17:32:00 1997 PST | 1 | 0 | 0
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:00 1997 PST | 1 | 0 | 0
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 14:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Thu Jul 10 14:32:01 1997 PDT | 3 | 1000 | 1000000
|
Mon Feb 10 09:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Tue Jun 10 18:32:01 1997 PDT | 2 | 1000 | 1000000
|
Mon Feb 10 14:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Thu Jul 10 14:32:01 1997 PDT | 3 | 1000 | 1000000
|
||||||
| Tue Feb 11 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Tue Jun 10 18:32:01 1997 PDT | 2 | 1000 | 1000000
|
||||||
| Wed Feb 12 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Mon Feb 10 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Thu Feb 13 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Tue Feb 11 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Fri Feb 14 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Wed Feb 12 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Sat Feb 15 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Thu Feb 13 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Sun Feb 16 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Fri Feb 14 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Sun Feb 16 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Sat Feb 15 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Wed Feb 28 17:32:01 1996 PST | 1 | 1000 | 1000000
|
Sun Feb 16 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Thu Feb 29 17:32:01 1996 PST | 1 | 1000 | 1000000
|
Tue Feb 16 17:32:01 0097 PST BC | 1 | 1000 | 1000000
|
||||||
| Fri Mar 01 17:32:01 1996 PST | 1 | 1000 | 1000000
|
Sat Feb 16 17:32:01 0097 PST | 1 | 1000 | 1000000
|
||||||
| Mon Dec 30 17:32:01 1996 PST | 4 | 1000 | 1000000
|
Thu Feb 16 17:32:01 0597 PST | 1 | 1000 | 1000000
|
||||||
| Tue Dec 31 17:32:01 1996 PST | 4 | 1000 | 1000000
|
Tue Feb 16 17:32:01 1097 PST | 1 | 1000 | 1000000
|
||||||
| Wed Jan 01 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Sat Feb 16 17:32:01 1697 PST | 1 | 1000 | 1000000
|
||||||
| Fri Feb 28 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Thu Feb 16 17:32:01 1797 PST | 1 | 1000 | 1000000
|
||||||
| Sat Mar 01 17:32:01 1997 PST | 1 | 1000 | 1000000
|
Tue Feb 16 17:32:01 1897 PST | 1 | 1000 | 1000000
|
||||||
| Tue Dec 30 17:32:01 1997 PST | 4 | 1000 | 1000000
|
Sun Feb 16 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
| Wed Dec 31 17:32:01 1997 PST | 4 | 1000 | 1000000
|
Sat Feb 16 17:32:01 2097 PST | 1 | 1000 | 1000000
|
||||||
| Fri Dec 31 17:32:01 1999 PST | 4 | 1000 | 1000000
|
Wed Feb 28 17:32:01 1996 PST | 1 | 1000 | 1000000
|
||||||
| Sat Jan 01 17:32:01 2000 PST | 1 | 1000 | 1000000
|
Thu Feb 29 17:32:01 1996 PST | 1 | 1000 | 1000000
|
||||||
| Sun Dec 31 17:32:01 2000 PST | 4 | 1000 | 1000000
|
Fri Mar 01 17:32:01 1996 PST | 1 | 1000 | 1000000
|
||||||
| Mon Jan 01 17:32:01 2001 PST | 1 | 1000 | 1000000
|
Mon Dec 30 17:32:01 1996 PST | 4 | 1000 | 1000000
|
||||||
(56 rows)
|
Tue Dec 31 17:32:01 1996 PST | 4 | 1000 | 1000000
|
||||||
|
Wed Jan 01 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
|
Fri Feb 28 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
|
Sat Mar 01 17:32:01 1997 PST | 1 | 1000 | 1000000
|
||||||
|
Tue Dec 30 17:32:01 1997 PST | 4 | 1000 | 1000000
|
||||||
|
Wed Dec 31 17:32:01 1997 PST | 4 | 1000 | 1000000
|
||||||
|
Fri Dec 31 17:32:01 1999 PST | 4 | 1000 | 1000000
|
||||||
|
Sat Jan 01 17:32:01 2000 PST | 1 | 1000 | 1000000
|
||||||
|
Sun Dec 31 17:32:01 2000 PST | 4 | 1000 | 1000000
|
||||||
|
Mon Jan 01 17:32:01 2001 PST | 1 | 1000 | 1000000
|
||||||
|
(66 rows)
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as timestamptz,
|
SELECT d1 as timestamptz,
|
||||||
date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
|
date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
|
||||||
date_part( 'dow', d1) AS dow
|
date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
|
||||||
FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
date_part( 'doy', d1) AS doy
|
||||||
54 | timestamptz | isoyear | week | dow
|
FROM TIMESTAMPTZ_TBL;
|
||||||
----+--------------------------------+---------+------+-----
|
timestamptz | isoyear | week | isodow | dow | doy
|
||||||
| Wed Dec 31 16:00:00 1969 PST | 1970 | 1 | 3
|
---------------------------------+-----------+------+--------+-----+-----
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
-infinity | -Infinity | | | |
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
infinity | Infinity | | | |
|
||||||
| Mon Feb 10 17:32:02 1997 PST | 1997 | 7 | 1
|
Wed Dec 31 16:00:00 1969 PST | 1970 | 1 | 3 | 3 | 365
|
||||||
| Mon Feb 10 17:32:01.4 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01.5 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01.6 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:02 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Thu Jan 02 00:00:00 1997 PST | 1997 | 1 | 4
|
Mon Feb 10 17:32:01.4 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Thu Jan 02 03:04:05 1997 PST | 1997 | 1 | 4
|
Mon Feb 10 17:32:01.5 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01.6 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Thu Jan 02 00:00:00 1997 PST | 1997 | 1 | 4 | 4 | 2
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Thu Jan 02 03:04:05 1997 PST | 1997 | 1 | 4 | 4 | 2
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Tue Jun 10 17:32:01 1997 PDT | 1997 | 24 | 2
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Sat Sep 22 18:19:20 2001 PDT | 2001 | 38 | 6
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Wed Mar 15 08:14:01 2000 PST | 2000 | 11 | 3
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Wed Mar 15 04:14:02 2000 PST | 2000 | 11 | 3
|
Tue Jun 10 17:32:01 1997 PDT | 1997 | 24 | 2 | 2 | 161
|
||||||
| Wed Mar 15 02:14:03 2000 PST | 2000 | 11 | 3
|
Sat Sep 22 18:19:20 2001 PDT | 2001 | 38 | 6 | 6 | 265
|
||||||
| Wed Mar 15 03:14:04 2000 PST | 2000 | 11 | 3
|
Wed Mar 15 08:14:01 2000 PST | 2000 | 11 | 3 | 3 | 75
|
||||||
| Wed Mar 15 01:14:05 2000 PST | 2000 | 11 | 3
|
Wed Mar 15 04:14:02 2000 PST | 2000 | 11 | 3 | 3 | 75
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Wed Mar 15 02:14:03 2000 PST | 2000 | 11 | 3 | 3 | 75
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Wed Mar 15 03:14:04 2000 PST | 2000 | 11 | 3 | 3 | 75
|
||||||
| Mon Feb 10 17:32:00 1997 PST | 1997 | 7 | 1
|
Wed Mar 15 01:14:05 2000 PST | 2000 | 11 | 3 | 3 | 75
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:00 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 14:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Thu Jul 10 14:32:01 1997 PDT | 1997 | 28 | 4
|
Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Tue Jun 10 18:32:01 1997 PDT | 1997 | 24 | 2
|
Mon Feb 10 09:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1
|
Mon Feb 10 14:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Tue Feb 11 17:32:01 1997 PST | 1997 | 7 | 2
|
Thu Jul 10 14:32:01 1997 PDT | 1997 | 28 | 4 | 4 | 191
|
||||||
| Wed Feb 12 17:32:01 1997 PST | 1997 | 7 | 3
|
Tue Jun 10 18:32:01 1997 PDT | 1997 | 24 | 2 | 2 | 161
|
||||||
| Thu Feb 13 17:32:01 1997 PST | 1997 | 7 | 4
|
Mon Feb 10 17:32:01 1997 PST | 1997 | 7 | 1 | 1 | 41
|
||||||
| Fri Feb 14 17:32:01 1997 PST | 1997 | 7 | 5
|
Tue Feb 11 17:32:01 1997 PST | 1997 | 7 | 2 | 2 | 42
|
||||||
| Sat Feb 15 17:32:01 1997 PST | 1997 | 7 | 6
|
Wed Feb 12 17:32:01 1997 PST | 1997 | 7 | 3 | 3 | 43
|
||||||
| Sun Feb 16 17:32:01 1997 PST | 1997 | 7 | 0
|
Thu Feb 13 17:32:01 1997 PST | 1997 | 7 | 4 | 4 | 44
|
||||||
| Sun Feb 16 17:32:01 1997 PST | 1997 | 7 | 0
|
Fri Feb 14 17:32:01 1997 PST | 1997 | 7 | 5 | 5 | 45
|
||||||
| Wed Feb 28 17:32:01 1996 PST | 1996 | 9 | 3
|
Sat Feb 15 17:32:01 1997 PST | 1997 | 7 | 6 | 6 | 46
|
||||||
| Thu Feb 29 17:32:01 1996 PST | 1996 | 9 | 4
|
Sun Feb 16 17:32:01 1997 PST | 1997 | 7 | 7 | 0 | 47
|
||||||
| Fri Mar 01 17:32:01 1996 PST | 1996 | 9 | 5
|
Tue Feb 16 17:32:01 0097 PST BC | -96 | 7 | 2 | 2 | 47
|
||||||
| Mon Dec 30 17:32:01 1996 PST | 1997 | 1 | 1
|
Sat Feb 16 17:32:01 0097 PST | 97 | 7 | 6 | 6 | 47
|
||||||
| Tue Dec 31 17:32:01 1996 PST | 1997 | 1 | 2
|
Thu Feb 16 17:32:01 0597 PST | 597 | 7 | 4 | 4 | 47
|
||||||
| Wed Jan 01 17:32:01 1997 PST | 1997 | 1 | 3
|
Tue Feb 16 17:32:01 1097 PST | 1097 | 7 | 2 | 2 | 47
|
||||||
| Fri Feb 28 17:32:01 1997 PST | 1997 | 9 | 5
|
Sat Feb 16 17:32:01 1697 PST | 1697 | 7 | 6 | 6 | 47
|
||||||
| Sat Mar 01 17:32:01 1997 PST | 1997 | 9 | 6
|
Thu Feb 16 17:32:01 1797 PST | 1797 | 7 | 4 | 4 | 47
|
||||||
| Tue Dec 30 17:32:01 1997 PST | 1998 | 1 | 2
|
Tue Feb 16 17:32:01 1897 PST | 1897 | 7 | 2 | 2 | 47
|
||||||
| Wed Dec 31 17:32:01 1997 PST | 1998 | 1 | 3
|
Sun Feb 16 17:32:01 1997 PST | 1997 | 7 | 7 | 0 | 47
|
||||||
| Fri Dec 31 17:32:01 1999 PST | 1999 | 52 | 5
|
Sat Feb 16 17:32:01 2097 PST | 2097 | 7 | 6 | 6 | 47
|
||||||
| Sat Jan 01 17:32:01 2000 PST | 1999 | 52 | 6
|
Wed Feb 28 17:32:01 1996 PST | 1996 | 9 | 3 | 3 | 59
|
||||||
| Sun Dec 31 17:32:01 2000 PST | 2000 | 52 | 0
|
Thu Feb 29 17:32:01 1996 PST | 1996 | 9 | 4 | 4 | 60
|
||||||
| Mon Jan 01 17:32:01 2001 PST | 2001 | 1 | 1
|
Fri Mar 01 17:32:01 1996 PST | 1996 | 9 | 5 | 5 | 61
|
||||||
(56 rows)
|
Mon Dec 30 17:32:01 1996 PST | 1997 | 1 | 1 | 1 | 365
|
||||||
|
Tue Dec 31 17:32:01 1996 PST | 1997 | 1 | 2 | 2 | 366
|
||||||
|
Wed Jan 01 17:32:01 1997 PST | 1997 | 1 | 3 | 3 | 1
|
||||||
|
Fri Feb 28 17:32:01 1997 PST | 1997 | 9 | 5 | 5 | 59
|
||||||
|
Sat Mar 01 17:32:01 1997 PST | 1997 | 9 | 6 | 6 | 60
|
||||||
|
Tue Dec 30 17:32:01 1997 PST | 1998 | 1 | 2 | 2 | 364
|
||||||
|
Wed Dec 31 17:32:01 1997 PST | 1998 | 1 | 3 | 3 | 365
|
||||||
|
Fri Dec 31 17:32:01 1999 PST | 1999 | 52 | 5 | 5 | 365
|
||||||
|
Sat Jan 01 17:32:01 2000 PST | 1999 | 52 | 6 | 6 | 1
|
||||||
|
Sun Dec 31 17:32:01 2000 PST | 2000 | 52 | 7 | 0 | 366
|
||||||
|
Mon Jan 01 17:32:01 2001 PST | 2001 | 1 | 1 | 1 | 1
|
||||||
|
(66 rows)
|
||||||
|
|
||||||
|
SELECT d1 as timestamptz,
|
||||||
|
date_part( 'decade', d1) AS decade,
|
||||||
|
date_part( 'century', d1) AS century,
|
||||||
|
date_part( 'millennium', d1) AS millennium,
|
||||||
|
round(date_part( 'julian', d1)) AS julian
|
||||||
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
timestamptz | decade | century | millennium | julian
|
||||||
|
---------------------------------+-----------+-----------+------------+-----------
|
||||||
|
-infinity | -Infinity | -Infinity | -Infinity | -Infinity
|
||||||
|
infinity | Infinity | Infinity | Infinity | Infinity
|
||||||
|
Wed Dec 31 16:00:00 1969 PST | 196 | 20 | 2 | 2440588
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:02 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01.4 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01.5 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01.6 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Thu Jan 02 00:00:00 1997 PST | 199 | 20 | 2 | 2450451
|
||||||
|
Thu Jan 02 03:04:05 1997 PST | 199 | 20 | 2 | 2450451
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Tue Jun 10 17:32:01 1997 PDT | 199 | 20 | 2 | 2450611
|
||||||
|
Sat Sep 22 18:19:20 2001 PDT | 200 | 21 | 3 | 2452176
|
||||||
|
Wed Mar 15 08:14:01 2000 PST | 200 | 20 | 2 | 2451619
|
||||||
|
Wed Mar 15 04:14:02 2000 PST | 200 | 20 | 2 | 2451619
|
||||||
|
Wed Mar 15 02:14:03 2000 PST | 200 | 20 | 2 | 2451619
|
||||||
|
Wed Mar 15 03:14:04 2000 PST | 200 | 20 | 2 | 2451619
|
||||||
|
Wed Mar 15 01:14:05 2000 PST | 200 | 20 | 2 | 2451619
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:00 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Mon Feb 10 09:32:01 1997 PST | 199 | 20 | 2 | 2450490
|
||||||
|
Mon Feb 10 09:32:01 1997 PST | 199 | 20 | 2 | 2450490
|
||||||
|
Mon Feb 10 09:32:01 1997 PST | 199 | 20 | 2 | 2450490
|
||||||
|
Mon Feb 10 14:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Thu Jul 10 14:32:01 1997 PDT | 199 | 20 | 2 | 2450641
|
||||||
|
Tue Jun 10 18:32:01 1997 PDT | 199 | 20 | 2 | 2450611
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | 199 | 20 | 2 | 2450491
|
||||||
|
Tue Feb 11 17:32:01 1997 PST | 199 | 20 | 2 | 2450492
|
||||||
|
Wed Feb 12 17:32:01 1997 PST | 199 | 20 | 2 | 2450493
|
||||||
|
Thu Feb 13 17:32:01 1997 PST | 199 | 20 | 2 | 2450494
|
||||||
|
Fri Feb 14 17:32:01 1997 PST | 199 | 20 | 2 | 2450495
|
||||||
|
Sat Feb 15 17:32:01 1997 PST | 199 | 20 | 2 | 2450496
|
||||||
|
Sun Feb 16 17:32:01 1997 PST | 199 | 20 | 2 | 2450497
|
||||||
|
Tue Feb 16 17:32:01 0097 PST BC | -10 | -1 | -1 | 1686043
|
||||||
|
Sat Feb 16 17:32:01 0097 PST | 9 | 1 | 1 | 1756537
|
||||||
|
Thu Feb 16 17:32:01 0597 PST | 59 | 6 | 1 | 1939158
|
||||||
|
Tue Feb 16 17:32:01 1097 PST | 109 | 11 | 2 | 2121779
|
||||||
|
Sat Feb 16 17:32:01 1697 PST | 169 | 17 | 2 | 2340925
|
||||||
|
Thu Feb 16 17:32:01 1797 PST | 179 | 18 | 2 | 2377449
|
||||||
|
Tue Feb 16 17:32:01 1897 PST | 189 | 19 | 2 | 2413973
|
||||||
|
Sun Feb 16 17:32:01 1997 PST | 199 | 20 | 2 | 2450497
|
||||||
|
Sat Feb 16 17:32:01 2097 PST | 209 | 21 | 3 | 2487022
|
||||||
|
Wed Feb 28 17:32:01 1996 PST | 199 | 20 | 2 | 2450143
|
||||||
|
Thu Feb 29 17:32:01 1996 PST | 199 | 20 | 2 | 2450144
|
||||||
|
Fri Mar 01 17:32:01 1996 PST | 199 | 20 | 2 | 2450145
|
||||||
|
Mon Dec 30 17:32:01 1996 PST | 199 | 20 | 2 | 2450449
|
||||||
|
Tue Dec 31 17:32:01 1996 PST | 199 | 20 | 2 | 2450450
|
||||||
|
Wed Jan 01 17:32:01 1997 PST | 199 | 20 | 2 | 2450451
|
||||||
|
Fri Feb 28 17:32:01 1997 PST | 199 | 20 | 2 | 2450509
|
||||||
|
Sat Mar 01 17:32:01 1997 PST | 199 | 20 | 2 | 2450510
|
||||||
|
Tue Dec 30 17:32:01 1997 PST | 199 | 20 | 2 | 2450814
|
||||||
|
Wed Dec 31 17:32:01 1997 PST | 199 | 20 | 2 | 2450815
|
||||||
|
Fri Dec 31 17:32:01 1999 PST | 199 | 20 | 2 | 2451545
|
||||||
|
Sat Jan 01 17:32:01 2000 PST | 200 | 20 | 2 | 2451546
|
||||||
|
Sun Dec 31 17:32:01 2000 PST | 200 | 20 | 2 | 2451911
|
||||||
|
Mon Jan 01 17:32:01 2001 PST | 200 | 21 | 3 | 2451912
|
||||||
|
(66 rows)
|
||||||
|
|
||||||
|
SELECT d1 as timestamptz,
|
||||||
|
date_part( 'timezone', d1) AS timezone,
|
||||||
|
date_part( 'timezone_hour', d1) AS timezone_hour,
|
||||||
|
date_part( 'timezone_minute', d1) AS timezone_minute
|
||||||
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
timestamptz | timezone | timezone_hour | timezone_minute
|
||||||
|
---------------------------------+----------+---------------+-----------------
|
||||||
|
-infinity | | |
|
||||||
|
infinity | | |
|
||||||
|
Wed Dec 31 16:00:00 1969 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:02 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01.4 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01.5 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01.6 1997 PST | -28800 | -8 | 0
|
||||||
|
Thu Jan 02 00:00:00 1997 PST | -28800 | -8 | 0
|
||||||
|
Thu Jan 02 03:04:05 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Tue Jun 10 17:32:01 1997 PDT | -25200 | -7 | 0
|
||||||
|
Sat Sep 22 18:19:20 2001 PDT | -25200 | -7 | 0
|
||||||
|
Wed Mar 15 08:14:01 2000 PST | -28800 | -8 | 0
|
||||||
|
Wed Mar 15 04:14:02 2000 PST | -28800 | -8 | 0
|
||||||
|
Wed Mar 15 02:14:03 2000 PST | -28800 | -8 | 0
|
||||||
|
Wed Mar 15 03:14:04 2000 PST | -28800 | -8 | 0
|
||||||
|
Wed Mar 15 01:14:05 2000 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:00 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 09:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 09:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 09:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Mon Feb 10 14:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Thu Jul 10 14:32:01 1997 PDT | -25200 | -7 | 0
|
||||||
|
Tue Jun 10 18:32:01 1997 PDT | -25200 | -7 | 0
|
||||||
|
Mon Feb 10 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Tue Feb 11 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Wed Feb 12 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Thu Feb 13 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Fri Feb 14 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Sat Feb 15 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Sun Feb 16 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Tue Feb 16 17:32:01 0097 PST BC | -28800 | -8 | 0
|
||||||
|
Sat Feb 16 17:32:01 0097 PST | -28800 | -8 | 0
|
||||||
|
Thu Feb 16 17:32:01 0597 PST | -28800 | -8 | 0
|
||||||
|
Tue Feb 16 17:32:01 1097 PST | -28800 | -8 | 0
|
||||||
|
Sat Feb 16 17:32:01 1697 PST | -28800 | -8 | 0
|
||||||
|
Thu Feb 16 17:32:01 1797 PST | -28800 | -8 | 0
|
||||||
|
Tue Feb 16 17:32:01 1897 PST | -28800 | -8 | 0
|
||||||
|
Sun Feb 16 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Sat Feb 16 17:32:01 2097 PST | -28800 | -8 | 0
|
||||||
|
Wed Feb 28 17:32:01 1996 PST | -28800 | -8 | 0
|
||||||
|
Thu Feb 29 17:32:01 1996 PST | -28800 | -8 | 0
|
||||||
|
Fri Mar 01 17:32:01 1996 PST | -28800 | -8 | 0
|
||||||
|
Mon Dec 30 17:32:01 1996 PST | -28800 | -8 | 0
|
||||||
|
Tue Dec 31 17:32:01 1996 PST | -28800 | -8 | 0
|
||||||
|
Wed Jan 01 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Fri Feb 28 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Sat Mar 01 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Tue Dec 30 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Wed Dec 31 17:32:01 1997 PST | -28800 | -8 | 0
|
||||||
|
Fri Dec 31 17:32:01 1999 PST | -28800 | -8 | 0
|
||||||
|
Sat Jan 01 17:32:01 2000 PST | -28800 | -8 | 0
|
||||||
|
Sun Dec 31 17:32:01 2000 PST | -28800 | -8 | 0
|
||||||
|
Mon Jan 01 17:32:01 2001 PST | -28800 | -8 | 0
|
||||||
|
(66 rows)
|
||||||
|
|
||||||
-- TO_CHAR()
|
-- TO_CHAR()
|
||||||
SELECT '' AS to_char_1, to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
SELECT '' AS to_char_1, to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||||
|
@ -178,21 +178,30 @@ SELECT '' AS "54", d1 - timestamp without time zone '1997-01-02' AS diff
|
|||||||
WHERE d1 BETWEEN timestamp without time zone '1902-01-01'
|
WHERE d1 BETWEEN timestamp without time zone '1902-01-01'
|
||||||
AND timestamp without time zone '2038-01-01';
|
AND timestamp without time zone '2038-01-01';
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as "timestamp",
|
-- DATE_PART (timestamp_part)
|
||||||
|
SELECT d1 as "timestamp",
|
||||||
date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
|
date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
|
||||||
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
|
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
|
||||||
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
|
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
|
||||||
FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
FROM TIMESTAMP_TBL;
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as "timestamp",
|
SELECT d1 as "timestamp",
|
||||||
date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
|
date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
|
||||||
date_part( 'usec', d1) AS usec
|
date_part( 'usec', d1) AS usec
|
||||||
FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
FROM TIMESTAMP_TBL;
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as "timestamp",
|
SELECT d1 as "timestamp",
|
||||||
date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
|
date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
|
||||||
date_part( 'dow', d1) AS dow
|
date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
|
||||||
FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
date_part( 'doy', d1) AS doy
|
||||||
|
FROM TIMESTAMP_TBL;
|
||||||
|
|
||||||
|
SELECT d1 as "timestamp",
|
||||||
|
date_part( 'decade', d1) AS decade,
|
||||||
|
date_part( 'century', d1) AS century,
|
||||||
|
date_part( 'millennium', d1) AS millennium,
|
||||||
|
round(date_part( 'julian', d1)) AS julian
|
||||||
|
FROM TIMESTAMP_TBL;
|
||||||
|
|
||||||
-- TO_CHAR()
|
-- TO_CHAR()
|
||||||
SELECT '' AS to_char_1, to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
SELECT '' AS to_char_1, to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||||
|
@ -198,21 +198,36 @@ SELECT '' AS "54", d1 - timestamp with time zone '1997-01-02' AS diff
|
|||||||
FROM TIMESTAMPTZ_TBL
|
FROM TIMESTAMPTZ_TBL
|
||||||
WHERE d1 BETWEEN timestamp with time zone '1902-01-01' AND timestamp with time zone '2038-01-01';
|
WHERE d1 BETWEEN timestamp with time zone '1902-01-01' AND timestamp with time zone '2038-01-01';
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as timestamptz,
|
-- DATE_PART (timestamptz_part)
|
||||||
|
SELECT d1 as timestamptz,
|
||||||
date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
|
date_part( 'year', d1) AS year, date_part( 'month', d1) AS month,
|
||||||
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
|
date_part( 'day', d1) AS day, date_part( 'hour', d1) AS hour,
|
||||||
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
|
date_part( 'minute', d1) AS minute, date_part( 'second', d1) AS second
|
||||||
FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as timestamptz,
|
SELECT d1 as timestamptz,
|
||||||
date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
|
date_part( 'quarter', d1) AS quarter, date_part( 'msec', d1) AS msec,
|
||||||
date_part( 'usec', d1) AS usec
|
date_part( 'usec', d1) AS usec
|
||||||
FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
|
||||||
SELECT '' AS "54", d1 as timestamptz,
|
SELECT d1 as timestamptz,
|
||||||
date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
|
date_part( 'isoyear', d1) AS isoyear, date_part( 'week', d1) AS week,
|
||||||
date_part( 'dow', d1) AS dow
|
date_part( 'isodow', d1) AS isodow, date_part( 'dow', d1) AS dow,
|
||||||
FROM TIMESTAMPTZ_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01';
|
date_part( 'doy', d1) AS doy
|
||||||
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
|
||||||
|
SELECT d1 as timestamptz,
|
||||||
|
date_part( 'decade', d1) AS decade,
|
||||||
|
date_part( 'century', d1) AS century,
|
||||||
|
date_part( 'millennium', d1) AS millennium,
|
||||||
|
round(date_part( 'julian', d1)) AS julian
|
||||||
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
|
||||||
|
SELECT d1 as timestamptz,
|
||||||
|
date_part( 'timezone', d1) AS timezone,
|
||||||
|
date_part( 'timezone_hour', d1) AS timezone_hour,
|
||||||
|
date_part( 'timezone_minute', d1) AS timezone_minute
|
||||||
|
FROM TIMESTAMPTZ_TBL;
|
||||||
|
|
||||||
-- TO_CHAR()
|
-- TO_CHAR()
|
||||||
SELECT '' AS to_char_1, to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
SELECT '' AS to_char_1, to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon')
|
||||||
|
Loading…
Reference in New Issue
Block a user