Re: right way of using case-expressions in plpgsql functions

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: right way of using case-expressions in plpgsql functions
Дата
Msg-id CAKFQuwbb4_XaC4PxVJEP+L8zWKFuBNRfz7+rQhub4TozcAjMBQ@mail.gmail.com
обсуждение исходный текст
Ответ на right way of using case-expressions in plpgsql functions  (Victor Dobrovolsky <booby.stager@gmail.com>)
Ответы Re: right way of using case-expressions in plpgsql functions
Список pgsql-general
On Sunday, October 15, 2023, Victor Dobrovolsky <booby.stager@gmail.com> wrote:

select (case when px is not null then pf = px
        else pf is not distinct from py
end);


Every single time this function is called “px is not null” will be evaluated and then one of the two branches will be evaluated.  Nothing the optimizer does will change that.  The planner for the function internals does not know whether px will or will not be null on any given invocation.

David J.

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

Предыдущее
От: Victor Dobrovolsky
Дата:
Сообщение: right way of using case-expressions in plpgsql functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: right way of using case-expressions in plpgsql functions