Re: BUG #8516: Calling VOLATILE from STABLE function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #8516: Calling VOLATILE from STABLE function
Дата
Msg-id 3117.1381481316@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #8516: Calling VOLATILE from STABLE function  (Terje Elde <terje@elde.net>)
Список pgsql-bugs
Terje Elde <terje@elde.net> writes:
> Would it be possible (and make sense) to solve this in a completely different way, not walking the function tree or
doingstatic analysis, but simply setting and checking a bit during execution? 

While it's possible that we could do something like that, I think it's
fairly unlikely that we would.  The reason is that it would disable
constructs that some people find useful; that is, sometimes it's
intentional that a stable function calls a volatile one.

A couple of examples:

1. You might want to make some database updates but continue to do queries
with a pre-update snapshot.  A single function can't accomplish that,
but the combination of a stable outer function with a volatile update
function can.

2. A security checking function (for use with Veil or the proposed row
security feature) might wish to log accesses without denying them.  To
do that it'd have to be volatile, so if we had a restriction like this
the function would fail when invoked within a stable function.

You can imagine various ways around such issues, but it would add a lot
of complication.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bit String expand bug
Следующее
От: "Dwayne Towell"
Дата:
Сообщение: Re: BUG #8516: Calling VOLATILE from STABLE function