Re: BUG #8237: CASE Expression - Order of expression processing

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #8237: CASE Expression - Order of expression processing
Дата
Msg-id 10821.1371612644@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #8237: CASE Expression - Order of expression processing  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: BUG #8237: CASE Expression - Order of expression processing  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-bugs
Andres Freund <andres@2ndquadrant.com> writes:
> On 2013-06-18 13:17:14 +0000, andrea@lombardoni.ch wrote:
>> template1=# SELECT CASE WHEN (SELECT 0)=0 THEN 0 ELSE 1/0 END;
>> ERROR:  division by zero

> Hrmpf. This is rather annoying.

Annoying, maybe.  Bug, no.  The manual is pretty clear that you don't
have a lot of control over order of evaluation of subexpressions.

> So it seems we need to stop processing after finding a single WHEN
> that's not const?

That's not an acceptable "fix".

            regards, tom lane

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

Предыдущее
От: niflheim123@gmail.com
Дата:
Сообщение: BUG #8239: postgresql cannot run after install with apt-get because of permisions
Следующее
От: Andres Freund
Дата:
Сообщение: Re: BUG #8237: CASE Expression - Order of expression processing