Re: Wrong output for 7.0.3 from NULL fields in CASE statement

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Wrong output for 7.0.3 from NULL fields in CASE statement
Дата
Msg-id 20287.983426186@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Wrong output for 7.0.3 from NULL fields in CASE statement  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
pgsql-bugs@postgresql.org writes:
> foobar=# select text(CASE WHEN (cashback = NULL or cashback = 0) THEN '0' ELSE cashback END) from
transaction_paymentswhere idnum = 139 and payment_type = 6; 
>          text
> -----------------------
>  1.01855797968803e-312
> (1 row)

Try not quoting the '0'.  For reasons that I don't recall at the moment,
7.0 has a problem coercing unknown-type literals to the proper datatype
in CASE expressions.  It seems to work OK in 7.1 though.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Wrong output for 7.0.3 from NULL fields in CASE statement
Следующее
От: Justin Clift
Дата:
Сообщение: Oops... sorry about that