Postgres behavior - Conditional statements - Mailing list pgsql-sql

From Kumar Babu P G
Subject Postgres behavior - Conditional statements
Date
Msg-id CAA5_7crQLLN=Wr7gp4ykhmTZxrbtSfXjucQeoi2uyec79N1Z7Q@mail.gmail.com
Whole thread Raw
Responses Re: Postgres behavior - Conditional statements
List pgsql-sql
HI All,

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 9.1

postgres=>  create table test (a int, b int);

CREATE TABLE

postgres=>  insert into test values (1,1);

INSERT 0 1

postgres=> select case when exists (select 1 from test where a=1) then 0 else (select b from test where a=2) end;

 case 

------

    0

(1 row)


Postgres 9.2

postgres=> select case when exists (select 1 from test where a=1) then 0 else (select b from test where a=2) end;

 b 

---

 0

(1 row)


Regards,

Kumar.

pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: How to unnest an array with element indexes
Next
From: amul sul
Date:
Subject: SRF_RETURN_NEXT Error: rows returned by function are not all of the same row type