Re: function side effects
| От | Tom Lane |
|---|---|
| Тема | Re: function side effects |
| Дата | |
| Msg-id | 9226.1266900582@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | function side effects (Tatsuo Ishii <ishii@postgresql.org>) |
| Ответы |
Re: function side effects
Re: function side effects |
| Список | 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 по дате отправления: