Re: BUG #12273: CASE Expression BUG - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #12273: CASE Expression BUG
Date
Msg-id 4028.1418937266@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #12273: CASE Expression BUG  (David Johnston <david.g.johnston@gmail.com>)
List pgsql-bugs
David Johnston <david.g.johnston@gmail.com> writes:
> On Thu, Dec 18, 2014 at 1:33 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> That's why that isn't the example ;-).  In this case, since the WHEN is a
>> constant, the constant-expression simplifier itself figures out that it
>> can throw away the THEN expression and replace the whole CASE with the
>> ELSE expression.  So it doesn't bother const-simplifying the THEN, hence
>> no error.

> ​Is the example with the "WITH" CTE too involved to use instead?​

Doesn't seem like it really adds anything.

>> Meh.  The same principle applies in other languages too, so I don't think
>> your wording is an improvement.

> ​Your's just didn't read that well to me...though the overall content was
> good.  Maybe drop "Thus" and just lead with "Within PL/pgSQL functions, for
> example, using an IF [...]"

OK.

            regards, tom lane

pgsql-bugs by date:

Previous
From: David Johnston
Date:
Subject: Re: BUG #12273: CASE Expression BUG
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #12275: configure incorrectly tests libxml2 version