Re: BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marcus(at)cockroachlabs(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results
Date: 2022-01-19 21:42:44
Message-ID: 733296.1642628564@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> I believe casts from INTERVAL to TEXT (and other string-like types such as
> CHAR, NAME, VARCHAR, and "char") should have a volatility of stable, not
> immutable, because the results of these casts depend on IntervalStyle.

Ugh, right, interval_out is marked immutable and should not be.

The cost/benefit of trying to change this in released branches doesn't
seem attractive, but we can fix it for v15 and up.

(Oddly, interval_in is already correctly marked as STABLE. I'm not
sure how it got to be that way with nobody noticing the mistake
for interval_out.)

Thanks for the report!

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-01-20 04:00:01 BUG #17372: Altering statistics during concurrent drop can lead to a server crash
Previous Message PG Bug reporting form 2022-01-19 21:06:41 BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results