Обсуждение: immutable stable volatile

Поиск
Список
Период
Сортировка

immutable stable volatile

От
"PostgreSQL general mail list"
Дата:
hello,

I have read the documentation couple of times and I still can not figure out
the following aspects.

if a function does insert/update/delete it needs to be stable or volatile ?
if a immutable function executes 'nextval' should itself be also volatile ?

thanks,
Razvan Radu


Re: immutable stable volatile

От
Tom Lane
Дата:
"PostgreSQL general mail list" <pgsql-general@list.coretech.ro> writes:
> if a function does insert/update/delete it needs to be stable or volatile ?
> if a immutable function executes 'nextval' should itself be also volatile ?

A function that has side-effects must be marked volatile; there are
no exceptions.

PG 8.0 actually enforces this to some extent, but you can get burned in
any version if you ignore the rule.

            regards, tom lane