Postgres behavior - Conditional statements

Поиск
Список
Период
Сортировка
От Kumar Babu P G
Тема Postgres behavior - Conditional statements
Дата
Msg-id CAA5_7crQLLN=Wr7gp4ykhmTZxrbtSfXjucQeoi2uyec79N1Z7Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Postgres behavior - Conditional statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: How to unnest an array with element indexes
Следующее
От: amul sul
Дата:
Сообщение: SRF_RETURN_NEXT Error: rows returned by function are not all of the same row type