From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: interval_out() must be marked STABLE, not IMMUTABLE.
Date: Wed, 19 Jan 2022 22:18:05 +0000
Message-ID: <E1nAJHJ-0006vd-J6@gemulon.postgresql.org> (raw)
interval_out() must be marked STABLE, not IMMUTABLE.
Its results vary depending on the IntervalStyle GUC, so it cannot
be considered immutable.
This is an extremely ancient bug. AFAICT it was a sloppy mistake
in 6f58115dd, which marked it "cacheable" alongside marking several
other interval functions that way. At the time, interval_out()
depended on DateStyle not IntervalStyle, but it was still wrong.
Back-patching this change doesn't look very practical, so I won't.
Aside from the usual difficulties of getting catalog changes
applied to existing databases, people might have indexes,
generated columns, etc that depend on interval-to-text casts
being considered immutable. (This'd not really give them any
problem as long as they never change IntervalStyle.) They
wouldn't appreciate us breaking such usage in minor releases.
Per bug #17371 from Marcus Gartner.
Discussion: https://postgr.es/m/17371-8f57e6e9ca5e35bf@postgresql.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a3d6264bbce0ff7002be35a907b73b01e2e37f45
Modified Files
--------------
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: interval_out() must be marked STABLE, not IMMUTABLE.
In-Reply-To: <E1nAJHJ-0006vd-J6@gemulon.postgresql.org>
References: <E1nAJHJ-0006vd-J6@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox