On Mon, Oct 10, 2016 at 11:56 AM, <hcate3@gmail.com> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14363
> Logged by: Henry Cate
> Email address: hcate3@gmail.com
> PostgreSQL version: 9.5.2
> Operating system: x86_64-pc-linux-gnu
> Description:
>
>
> ybd_test=3D# select version();
> version
>
> ------------------------------------------------------------
> --------------------------------------------------------
> PostgreSQL 9.5.2 on x86_64-pc-linux-gnu, compiled by clang version
> 3.8.0-2ubuntu3 (tags/RELEASE_380/final), 64-bit
>
=E2=80=8BSame result in 9.3.12
=E2=80=8BIt seems like "case" is too complex an expression to be embedded i=
nto the
<..."simple" form of CASE expression...>
SELECT
case (
case decimal_9_1
when decimal_18_1 then 0
when decimal_9_1 then 1
end
)
when 1 then 2
when 0 then 3
end
https://www.postgresql.org/docs/9.5/static/functions-conditional.html
I suspect this is some kind of long-standing bug that hasn't been seen due
to this being a unusual way to write a case expression - mainly since the
embedded case evaluates correctly if it is done as a top-level expression.
David J.