Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Craig Ringer <craig@xxxxxxxxxxxxxxxxxxxxx> writes:
> Merlin Moncure wrote:
>> On Thu, Nov 20, 2008 at 6:21 AM, Sabin Coanda
>> <sabin.coanda@xxxxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux