Re: hidden errors calling a volatile function inside a stable function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: hidden errors calling a volatile function inside a stable function
Дата
Msg-id 2753.1227197909@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: hidden errors calling a volatile function inside a stable function  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
Craig Ringer <craig@postnewspapers.com.au> writes:
> Merlin Moncure wrote:
>> On Thu, Nov 20, 2008 at 6:21 AM, Sabin Coanda
>> <sabin.coanda@deuromedia.ro> wrote:
>>> I found in a STABLE function, for instance "TEST_0"(), it is not allowed to
>>> use INSERT statement. Trying this will give me the error:
>>> ERROR: INSERT is not allowed in a non-volatile function
>>
>> Why did you lie when your declared your function stable? :-)

> I suspect the point here is that PostgreSQL tries to stop you violating
> your claims about the function's stability by preventing DML operations.
> However, it doesn't also attempt to prevent invocation of volatile
> functions.

All this behavior is documented; see
http://www.postgresql.org/docs/8.3/static/xfunc-volatility.html
particularly the NOTE at the bottom.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: List Ettiquette (perhaps Off Topic by now) was: Re: Database access over the Internet...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: date range query help