Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAIjC-0001Md-4f for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Jan 2022 21:42:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAIjA-000449-Uk for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Jan 2022 21:42:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAIjA-000440-L8 for pgsql-bugs@lists.postgresql.org; Wed, 19 Jan 2022 21:42:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAIj8-0000id-E4 for pgsql-bugs@lists.postgresql.org; Wed, 19 Jan 2022 21:42:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 20JLgifF733297; Wed, 19 Jan 2022 16:42:44 -0500 From: Tom Lane To: marcus@cockroachlabs.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17371: Immutable INTERVAL to TEXT cast can cause incorrect query results In-reply-to: <17371-8f57e6e9ca5e35bf@postgresql.org> References: <17371-8f57e6e9ca5e35bf@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 19 Jan 2022 21:06:41 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <733295.1642628564.1@sss.pgh.pa.us> Date: Wed, 19 Jan 2022 16:42:44 -0500 Message-ID: <733296.1642628564@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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