Kumar Babu P G <kumar.pulakunta@gmail.com> writes:
> Found strange behavior of postgres between 9.1 and 9.2. Can some one
> pointout the reason for the difference in column name of the output between
> the versions?
> postgres=> select case when exists (select 1 from test where a=1) then 0
> else (select b from test where a=2) end;
http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=5ec6b7f1b87f0fa006b8e08a11cd4e99bcb67358
The behavior of CASE didn't change, but the behavior of the sub-select
did. More simply, 9.1 gives this
regression=# select (select b from test where a=2); ?column?
----------
(1 row)
while 9.2 and up give
regression=# select (select b from test where a=2);b
---
(1 row)
regards, tom lane