From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: cherio@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16653: Regression in CTE evaluation
Date: Sun, 04 Oct 2020 13:36:29 -0400
Message-ID: <1508304.1601832989@sss.pgh.pa.us> (raw)
In-Reply-To: <20201004171359.GA10396@momjian.us>
References: <16653-3154c42c219f8693@postgresql.org>
<20201004171359.GA10396@momjian.us>
Bruce Momjian <bruce@momjian.us> writes:
> On Sun, Oct 4, 2020 at 04:18:43PM +0000, PG Bug reporting form wrote:
>> The following SQL worked in versions 9 through 12. It is throwing an error
>> in version 13.
> Uh, I am able to reproduce the error in PG _12_ as well, and I am sure
> it is related to this change in PG 12:
> Allow common table expressions (CTEs) to be inlined into the outer query
> (Andreas Karlsson, Andrew Gierth, David Fetter, Tom Lane)
Indeed. The planner now inlines the WITH query, allowing
"CAST(exp_days.days || ' days' AS interval)" to be folded to a constant,
whereupon you get an error since indeed ' days' isn't valid interval
input.
Sorry, I reject the position that this is a bug. It was something of
an implementation artifact that you didn't get this error before.
As of v12, we provide explicit control over whether a WITH query can
be inlined or not, and you need to use that control if you have a
query that's dependent on inlining not happening.
regards, tom lane
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, bruce@momjian.us, cherio@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16653: Regression in CTE evaluation
In-Reply-To: <1508304.1601832989@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