summaryrefslogtreecommitdiff
path: root/src/test/regress/sql/jsonb_jsonpath.sql
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-10-30 11:42:28 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-10-30 11:42:34 -0400
commita358019159de68d4f045cbb5d89c8c8c2e96e483 (patch)
tree9788114bf408e254cb85f3a68939d4a5d5c8d7c1 /src/test/regress/sql/jsonb_jsonpath.sql
parentc177726ae41a4c13c575f2adf8942687fb6ec954 (diff)
Stabilize jsonb_path_query test case.
An operation like '12:34:56'::time_tz takes the UTC offset from the prevailing time zone, which means that the results change across DST transitions. One of the test cases added in ed055d249 failed to consider this. Per report from Bernhard Wiedemann. Back-patch to v17, as the test case was. Discussion: https://postgr.es/m/ba8e1bc0-8a99-45b7-8397-3f2e94415e03@suse.de
Diffstat (limited to 'src/test/regress/sql/jsonb_jsonpath.sql')
-rw-r--r--src/test/regress/sql/jsonb_jsonpath.sql4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/regress/sql/jsonb_jsonpath.sql b/src/test/regress/sql/jsonb_jsonpath.sql
index c647af55e94..acb508c0dd2 100644
--- a/src/test/regress/sql/jsonb_jsonpath.sql
+++ b/src/test/regress/sql/jsonb_jsonpath.sql
@@ -596,7 +596,11 @@ select jsonb_path_query_tz('"2023-08-15 12:34:56"', '$.timestamp_tz().string()')
select jsonb_path_query('"2023-08-15 12:34:56 +5:30"', '$.timestamp_tz().string()');
select jsonb_path_query('"2023-08-15 12:34:56"', '$.timestamp().string()');
select jsonb_path_query('"12:34:56 +5:30"', '$.time_tz().string()');
+-- this timetz usage will absorb the UTC offset of the current timezone setting
+begin;
+set local timezone = 'UTC-10';
select jsonb_path_query_tz('"12:34:56"', '$.time_tz().string()');
+rollback;
select jsonb_path_query('"12:34:56"', '$.time().string()');
select jsonb_path_query('"2023-08-15"', '$.date().string()');