Re: function side effects - Mailing list pgsql-hackers

From Tom Lane
Subject Re: function side effects
Date
Msg-id 9226.1266900582@sss.pgh.pa.us
Whole thread Raw
In response to function side effects  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: function side effects
Re: function side effects
List pgsql-hackers
Tatsuo Ishii <ishii@postgresql.org> writes:
> I'm wondering if we could detect a funcion has a side effect,
> i.e. does a write to database.

> Currently we have three properties of functions: IMMUTABLE, STABLE and
> VOLATILE. According to docs IMMUTABLE or STABLE functions do not write
> to database.

Those classifications are meant as planner directives; they are NOT
meant to be bulletproof.  Hanging database integrity guarantees on
whether a "non volatile" function changes anything is entirely unsafe.
To give just one illustration of the problems, a nonvolatile function
is allowed to call a volatile one.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Takahiro Itagaki
Date:
Subject: Re: [SPAM]function side effects
Next
From: Fujii Masao
Date:
Subject: recovery.conf.sample