Question on STABLE functions limitations

Started by Marc Maminover 15 years ago3 messagesgeneral
Jump to latest
#1Marc Mamin
M.Mamin@intershop.de

Hello,

I wonder if there are some special cases where STABLE functions should
be avoided.

I think for example of functions using set_config or querying the
advisory locks.

Thanks in advance,

Marc Mamin

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Marc Mamin (#1)
Re: Question on STABLE functions limitations

"Marc Mamin" <M.Mamin@intershop.de> writes:

I wonder if there are some special cases where STABLE functions should
be avoided.

I think for example of functions using set_config or querying the
advisory locks.

set_config has side-effects and hence should not be done in non-volatile
functions.

regards, tom lane

#3Merlin Moncure
mmoncure@gmail.com
In reply to: Marc Mamin (#1)
Re: Question on STABLE functions limitations

On Mon, Oct 18, 2010 at 4:47 AM, Marc Mamin <M.Mamin@intershop.de> wrote:

I wonder if there are some special cases where STABLE functions should be
avoided.

I think for example of functions using set_config or querying the advisory
locks.

Advisory locks are highly volatile and everything that touches them
should be considered volatile. They are completely outside the mvcc
snapshot system and aren't bound by its rules (sequences also fall
under this category).

merlin