Re: Unexpected behaviour of a RAISE statement in an IMMUTABLE function

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Unexpected behaviour of a RAISE statement in an IMMUTABLE function
Дата
Msg-id CAKFQuwY=t2HXng-0pAZtxk89zpTGAF-i_QVB-naazhFUmRVt3A@mail.gmail.com
обсуждение исходный текст
Ответ на Unexpected behaviour of a RAISE statement in an IMMUTABLE function  (Joel Mukuthu <jom@upright.co>)
Список pgsql-bugs
On Wed, Nov 23, 2022 at 9:01 AM Joel Mukuthu <jom@upright.co> wrote:

Given the following two functions, where the only difference between them is that one is VOLATILE while the other is IMMUTABLE:


That is a huge difference


Is this behaviour expected?


Yes.

RAISE is a side-effect inducing statement, which disqualifies the function from being IMMUTABLE.

The immutable marker gives the system permission to execute the function, given constant arguments, once to find out what the value of that function is during the execution of the query and make decisions based upon that result.

David J.

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17693: Slow performance: Much slower queries on pg_stat_all_tables since 13.4
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unexpected behaviour of a RAISE statement in an IMMUTABLE function