| От | Tom Lane |
|---|---|
| Тема | Re: simple case syntax oddity in 8.0.0 |
| Дата | |
| Msg-id | 29358.1107361765@sss.pgh.pa.us обсуждение |
| Ответ на | simple case syntax oddity in 8.0.0 (Vlad <marchenko@gmail.com>) |
| Список | pgsql-general |
Vlad <marchenko@gmail.com> writes:
> Postgresql 8.0.0, FreeBSD 5.3
> test=> select case 0 when 0 then null else 1/0 end as test;
> ERROR: division by zero
Hmm ... unexpected side effect of the change to avoid evaluating the
test-expression multiple times. This used to be transformed into
this at parse time:
select case when 0=0 then null else 1/0 end as test;
and then constant-folding would do the right thing.
But now it's transformed into something sort of like
select (let x = 0 in case when x=0 then ...)
and the when-clause therefore appears not to be constant. I think
I can fix this for 8.0.2, though.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера