pgsql: Preserve tz when converting to jsonb timestamptz

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Preserve tz when converting to jsonb timestamptz
Date: 2024-07-30 11:58:13
Message-ID: E1sYlUb-001t2x-3f@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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: https://postgr.es/m/7DE080CE-6D8C-4794-9BD1-7D9699172FAB%40justatheory.com

Backpatch to release 17.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/524d490a9f4ab81d86bbedc6e429fbc27776351c

Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c | 25 +++++++++++++++++++++++++
src/test/regress/expected/jsonb_jsonpath.out | 4 ++--
2 files changed, 27 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-07-30 12:20:38 pgsql: Remove leftover function declaration
Previous Message Thomas Munro 2024-07-30 11:39:01 pgsql: Remove spinlocks and atomics from meson_options.txt.