Re: Wrong results from function that selects from vier after "created or replace"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Wrong results from function that selects from vier after "created or replace"
Дата
Msg-id 3401031.1602549490@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Wrong results from function that selects from vier after "created or replace"  (Bryn Llewellyn <bryn@yugabyte.com>)
Ответы Re: Wrong results from function that selects from vier after "created or replace"  (Bryn Llewellyn <bryn@yugabyte.com>)
Список pgsql-bugs
Bryn Llewellyn <bryn@yugabyte.com> writes:
> The attached self-contained testcase, "pg-bad-invalidation-bug.sql", seems to me definitely to demonstrate a bug.
I'veattached the spooled output as "pg-bad-invalidation-bug.txt" Do you agree that this is a bug? 

No.  You marked the functions as "immutable", and then you broke that
promise by changing what they'd need to output.  The planner had
already inlined the original output value of f1() into the calling
expressions in f2(), on the strength of it being allegedly immutable.
There is no mechanism for undoing that (short of a forced cache flush
or session end), nor should there need to be.

If I mark the functions as either stable or volatile, I see the
desired behavior.

            regards, tom lane



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

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Wrong results from function that selects from vier after "created or replace"
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Wrong results from function that selects from vier after "created or replace"