public inbox for [email protected]
help / color / mirror / Atom feedFrom: jian he <[email protected]>
To: PostgreSQL-development <[email protected]>
Subject: recently added jsonpath method change jsonb_path_query, jsonb_path_query_first immutability
Date: Tue, 6 Feb 2024 11:06:32 +0800
Message-ID: <CACJufxFZGhVsAAiTSAi9HOJPJ-bGyG6QkhNmS=mzWHZWxecbng@mail.gmail.com> (raw)
Hi.
this commit [0] changes immutability of jsonb_path_query,
jsonb_path_query_first?
If so, it may change other functions also.
demo:
begin;
SET LOCAL TIME ZONE 10.5;
with cte(s) as (select jsonb '"2023-08-15 12:34:56 +05:30"')
select jsonb_path_query(s,
'$.timestamp_tz()')::text,'+10.5'::text,'timestamp_tz'::text from cte
union all
select jsonb_path_query(s, '$.time()')::text,'+10.5'::text, 'time'::text
from cte
union all
select jsonb_path_query(s,
'$.timestamp()')::text,'+10.5'::text,'timestamp'::text from cte
union all
select jsonb_path_query(s, '$.date()')::text,'+10.5'::text, 'date'::text
from cte
union all
select jsonb_path_query(s, '$.time_tz()')::text,'+10.5'::text,
'time_tz'::text from cte;
SET LOCAL TIME ZONE -8;
with cte(s) as (select jsonb '"2023-08-15 12:34:56 +05:30"')
select jsonb_path_query(s,
'$.timestamp_tz()')::text,'-8'::text,'timestamp_tz'::text from cte
union all
select jsonb_path_query(s, '$.time()')::text,'-8'::text, 'time'::text from
cte
union all
select jsonb_path_query(s,
'$.timestamp()')::text,'-8'::text,'timestamp'::text from cte
union all
select jsonb_path_query(s, '$.date()')::text,'-8'::text, 'date'::text from
cte
union all
select jsonb_path_query(s, '$.time_tz()')::text,'-8'::text, 'time_tz'::text
from cte;
commit;
[0]
https://git.postgresql.org/cgit/postgresql.git/commit/?id=66ea94e8e606529bb334515f388c62314956739e
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: recently added jsonpath method change jsonb_path_query, jsonb_path_query_first immutability
In-Reply-To: <CACJufxFZGhVsAAiTSAi9HOJPJ-bGyG6QkhNmS=mzWHZWxecbng@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox