(1 row)
--
--- AT LOCAL with timetz
+-- Test timetz_zone, timetz_izone, AT LOCAL
--
BEGIN;
SET LOCAL TimeZone TO 'UTC';
SELECT f1 AS dat,
timezone(f1) AS dat_func,
f1 AT LOCAL AS dat_at_local,
- f1 AT TIME ZONE current_setting('TimeZone') AS dat_at_time
+ f1 AT TIME ZONE current_setting('TimeZone') AS dat_at_tz,
+ f1 AT TIME ZONE INTERVAL '00:00' AS dat_at_int
FROM TIMETZ_TBL
ORDER BY f1;
SELECT pg_get_viewdef('timetz_local_view', true);
- pg_get_viewdef
-------------------------------------------------------------------------
- SELECT f1 AS dat, +
- timezone(f1) AS dat_func, +
- (f1 AT LOCAL) AS dat_at_local, +
- (f1 AT TIME ZONE current_setting('TimeZone'::text)) AS dat_at_time+
- FROM timetz_tbl +
+ pg_get_viewdef
+-----------------------------------------------------------------------
+ SELECT f1 AS dat, +
+ timezone(f1) AS dat_func, +
+ (f1 AT LOCAL) AS dat_at_local, +
+ (f1 AT TIME ZONE current_setting('TimeZone'::text)) AS dat_at_tz,+
+ (f1 AT TIME ZONE '@ 0'::interval) AS dat_at_int +
+ FROM timetz_tbl +
ORDER BY f1;
(1 row)
TABLE timetz_local_view;
- dat | dat_func | dat_at_local | dat_at_time
-----------------+----------------+----------------+----------------
- 00:01:00-07 | 07:01:00+00 | 07:01:00+00 | 07:01:00+00
- 01:00:00-07 | 08:00:00+00 | 08:00:00+00 | 08:00:00+00
- 02:03:00-07 | 09:03:00+00 | 09:03:00+00 | 09:03:00+00
- 08:08:00-04 | 12:08:00+00 | 12:08:00+00 | 12:08:00+00
- 07:07:00-08 | 15:07:00+00 | 15:07:00+00 | 15:07:00+00
- 11:59:00-07 | 18:59:00+00 | 18:59:00+00 | 18:59:00+00
- 12:00:00-07 | 19:00:00+00 | 19:00:00+00 | 19:00:00+00
- 12:01:00-07 | 19:01:00+00 | 19:01:00+00 | 19:01:00+00
- 15:36:39-04 | 19:36:39+00 | 19:36:39+00 | 19:36:39+00
- 15:36:39-05 | 20:36:39+00 | 20:36:39+00 | 20:36:39+00
- 23:59:00-07 | 06:59:00+00 | 06:59:00+00 | 06:59:00+00
- 23:59:59.99-07 | 06:59:59.99+00 | 06:59:59.99+00 | 06:59:59.99+00
+ dat | dat_func | dat_at_local | dat_at_tz | dat_at_int
+----------------+----------------+----------------+----------------+----------------
+ 00:01:00-07 | 07:01:00+00 | 07:01:00+00 | 07:01:00+00 | 07:01:00+00
+ 01:00:00-07 | 08:00:00+00 | 08:00:00+00 | 08:00:00+00 | 08:00:00+00
+ 02:03:00-07 | 09:03:00+00 | 09:03:00+00 | 09:03:00+00 | 09:03:00+00
+ 08:08:00-04 | 12:08:00+00 | 12:08:00+00 | 12:08:00+00 | 12:08:00+00
+ 07:07:00-08 | 15:07:00+00 | 15:07:00+00 | 15:07:00+00 | 15:07:00+00
+ 11:59:00-07 | 18:59:00+00 | 18:59:00+00 | 18:59:00+00 | 18:59:00+00
+ 12:00:00-07 | 19:00:00+00 | 19:00:00+00 | 19:00:00+00 | 19:00:00+00
+ 12:01:00-07 | 19:01:00+00 | 19:01:00+00 | 19:01:00+00 | 19:01:00+00
+ 15:36:39-04 | 19:36:39+00 | 19:36:39+00 | 19:36:39+00 | 19:36:39+00
+ 15:36:39-05 | 20:36:39+00 | 20:36:39+00 | 20:36:39+00 | 20:36:39+00
+ 23:59:00-07 | 06:59:00+00 | 06:59:00+00 | 06:59:00+00 | 06:59:00+00
+ 23:59:59.99-07 | 06:59:59.99+00 | 06:59:59.99+00 | 06:59:59.99+00 | 06:59:59.99+00
(12 rows)
-DROP VIEW timetz_local_view;
-COMMIT;
+ROLLBACK;
SELECT date_part('epoch', TIME WITH TIME ZONE '2020-05-26 13:30:25.575401-04');
--
--- AT LOCAL with timetz
+-- Test timetz_zone, timetz_izone, AT LOCAL
--
BEGIN;
SET LOCAL TimeZone TO 'UTC';
SELECT f1 AS dat,
timezone(f1) AS dat_func,
f1 AT LOCAL AS dat_at_local,
- f1 AT TIME ZONE current_setting('TimeZone') AS dat_at_time
+ f1 AT TIME ZONE current_setting('TimeZone') AS dat_at_tz,
+ f1 AT TIME ZONE INTERVAL '00:00' AS dat_at_int
FROM TIMETZ_TBL
ORDER BY f1;
SELECT pg_get_viewdef('timetz_local_view', true);
TABLE timetz_local_view;
-DROP VIEW timetz_local_view;
-COMMIT;
+ROLLBACK;