Re: BUG #19644: byteaout, float8out and float4out are marked IMMUTABLE but depend on GUCs

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Staroverov Ilja <i(dot)staroverov(at)ftdata(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>, "jj-zhang25(at)mails(dot)tsinghua(dot)edu(dot)cn" <jj-zhang25(at)mails(dot)tsinghua(dot)edu(dot)cn>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19644: byteaout, float8out and float4out are marked IMMUTABLE but depend on GUCs
Date: 2026-10-29 14:42:52
Message-ID: CAHGQGwHmesfYv5ud_ub2hTfgNbD3UOpK6iQ=OrHpQ5MwtjVD7Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Oct 21, 2026 at 1:40 PM Staroverov Ilja <i(dot)staroverov(at)ftdata(dot)ru> wrote:
> age(timestamptz, timestamptz) is marked IMMUTABLE, but it computes the
> difference in the session's time zone, so its result depends on
> TimeZone:

You're right.

Codex also found the following IMMUTABLE functions whose results depend
on TimeZone when interpreting time zone abbreviations such as LMT:

timezone(text, timestamp)
timezone(text, timestamptz)
date_trunc(text, timestamptz, text)
date_add(timestamptz, interval, text)
date_subtract(timestamptz, interval, text)
generate_series(timestamptz, timestamptz, interval, text)
jsonb_path_exists(jsonb, jsonpath, jsonb, boolean)
jsonb_path_match(jsonb, jsonpath, jsonb, boolean)
jsonb_path_query(jsonb, jsonpath, jsonb, boolean)
jsonb_path_query_array(jsonb, jsonpath, jsonb, boolean)
jsonb_path_query_first(jsonb, jsonpath, jsonb, boolean)
jsonb_path_exists_opr(jsonb, jsonpath)
jsonb_path_match_opr(jsonb, jsonpath)

Maybe we need to mark these STABLE as well, but I'm concerned about
the impact of doing so...

Regards,

--
Fujii Masao

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tender Wang 2026-10-29 15:39:23 Re: BUG #19804: "variable not found in subplan target list", DISTINCT agg over Gather`
Previous Message Dilip Kumar 2026-10-29 14:23:43 Re: BUG #19791: ALTER COLUMN TYPE fails on an INCLUDE column of an index used by a foreign key