Re: postgres - CASE evaluates subexpression that is not needed to determine the result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kamenoqd Zelen <kamenoqd(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: postgres - CASE evaluates subexpression that is not needed to determine the result
Date: 2018-11-05 14:45:53
Message-ID: 7647.1541429153@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Kamenoqd Zelen <kamenoqd(at)gmail(dot)com> writes:
> I have the following 3 examples of case expressions in postgres, which I
> would expect to evaluate in the same way. However the first and the third
> give ERROR: invalid input syntax for integer: "2017.7". The second one
> returns true. Why is the difference?

Constant subexpressions get folded regardless of location.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andriy Bartash 2018-11-05 18:17:21 Update on bug #15468
Previous Message Pavel Stehule 2018-11-05 13:50:00 Re: postgres - CASE evaluates subexpression that is not needed to determine the result