functions marked STABLE not allowed to do INSERT

Поиск
Список
Период
Сортировка
От Tino Wildenhain
Тема functions marked STABLE not allowed to do INSERT
Дата
Msg-id 4378A70D.8050601@wildenhain.de
обсуждение исходный текст
Ответы Re: functions marked STABLE not allowed to do INSERT  (Jaime Casanova <systemguards@gmail.com>)
Re: functions marked STABLE not allowed to do INSERT  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-hackers
New in 8.1 it seems functions marked STABLE are
not allowed to have any INSERT statement in them.

However in this particular case, the insert does not
violate the rule:

"STABLE indicates that within a single table scan the function will 
consistently return the same result for the same argument values, but 
that its result could change across SQL statements."

it does basically lookup a value by a foreign key
and builds a surrogate key on demand.

I know I could make it volatile but otoh I really want
the optimizer to optimize calls away as possible.

Now, what to do beside a private revert to the
patch?

Regards
Tino


В списке pgsql-hackers по дате отправления:

Предыдущее
От: rasmusra@gmail.com
Дата:
Сообщение: Re: PostgreSQL roadmap for 8.2 and beyond.
Следующее
От: Jaime Casanova
Дата:
Сообщение: Re: functions marked STABLE not allowed to do INSERT