Preserve tz when converting to jsonb timestamptz
authorAndrew Dunstan <andrew@dunslane.net>
Tue, 30 Jul 2024 11:57:38 +0000 (07:57 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Tue, 30 Jul 2024 11:57:38 +0000 (07:57 -0400)
commit524d490a9f4ab81d86bbedc6e429fbc27776351c
tree4046749ff81cda4525940207c81e161799d2d2cc
parent06ffce4559d0f7d29e0d92d18b72b4b96772ad1c
Preserve tz when converting to jsonb timestamptz

This removes an inconsistency in the treatment of different datatypes by
the jsonpath timestamp_tz() function. Conversions from data types that
are not timestamp-aware, such as date and timestamp, are now treated
consistently with conversion from those that are such as timestamptz.

Author: David Wheeler
Reviewed-by: Junwang Zhao and Jeevan Chalke
Discussion: http://postgr.es/m/7DE080CE-6D8C-4794-9BD1-7D9699172FAB%40justatheory.com

Backpatch to release 17.
src/backend/utils/adt/jsonpath_exec.c
src/test/regress/expected/jsonb_jsonpath.out