Re: Possible bug on Postgres 12 (CASE THEN evaluated prematurely) - Change of behaviour compared to 11, 10, 9

From: Juan Fuentes <juanmarianofuentes(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Possible bug on Postgres 12 (CASE THEN evaluated prematurely) - Change of behaviour compared to 11, 10, 9
Date: 2020-06-04 15:20:43
Message-ID: 0051B075-67EE-41D9-8BA0-B9A5B35EB499@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks Tom!

I was just hopping somebody could point out if this kind of issue has been reported before spending 2 days fabricating a simpler self contained example.

Best,
Juan

> On 4 Jun 2020, at 16:26, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Juan Fuentes <juanmarianofuentes(at)gmail(dot)com> writes:
>> As you could see the query includes castings, we noticed testing with Postgres 12 that the castings of the CASE THEN statement (commented out below) where failing in some cases, of course if you do the INNER JOIN and CASE WHEN first our expectation is that the value can be casted.
>
> You're unlikely to get any useful comments on this if you don't provide
> a self-contained example. The query by itself lacks too many details.
> As an example, one way "t7.value::numeric = 1" could fail despite being
> inside a CASE is if t7 is a view whose "value" column is actually a
> constant. Flattening of the view would replace "t7.value" with that
> constant, and then constant-folding would cause the failure, and neither
> of those things are prevented by a CASE. I kind of doubt that that's
> the specific issue here, but I'm not going to guess at what is in your
> thirty-some input tables.
>
> regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2020-06-04 15:21:08 Re: what can go in root.crt ?
Previous Message Laurenz Albe 2020-06-04 15:04:37 Re: what can go in root.crt ?