Re: BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results
Date
Msg-id 733296.1642628564@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results
Next
From: PG Bug reporting form
Date:
Subject: BUG #17372: Altering statistics during concurrent drop can lead to a server crash