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  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: function side effects  (Simon Riggs <simon@2ndQuadrant.com>)
Список 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 по дате отправления:

Предыдущее
От: Takahiro Itagaki
Дата:
Сообщение: Re: [SPAM]function side effects
Следующее
От: Fujii Masao
Дата:
Сообщение: recovery.conf.sample