pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: marcus@cockroachlabs.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results
Date: Wed, 19 Jan 2022 16:42:44 -0500
Message-ID: <733296.1642628564@sss.pgh.pa.us> (raw)
In-Reply-To: <17371-8f57e6e9ca5e35bf@postgresql.org>
References: <17371-8f57e6e9ca5e35bf@postgresql.org>

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





view thread (2+ messages)

Message-ID: <733296.1642628564@sss.pgh.pa.us>
Permalink:  ../733296.1642628564@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/733296.1642628564@sss.pgh.pa.us

 · 

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: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, marcus@cockroachlabs.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results
  In-Reply-To: <733296.1642628564@sss.pgh.pa.us>

* 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