Immutable functions, Exceptions and the Query Optimizer

Поиск
Список
Период
Сортировка
От Cochise Ruhulessin
Тема Immutable functions, Exceptions and the Query Optimizer
Дата
Msg-id CAF1QUC7vR8-vLga91ztR-p+NtMmU3VTZ3SkObU7Dc6V2c4nFiA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Immutable functions, Exceptions and the Query Optimizer  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Список pgsql-general
Hello all,

If an immutable function raises an exception, is that exception cached by
the query optimizer? Or does it only cache in the case that a function
actually returns a value?

The use case is a table books(book_id NOT NULL PRIMARY KEY, type_id)
wherein type_id is considered immutable (enforced with a trigger).

The function f() must return type_id given book_id, and raise an exception
if no entity with book_id exists. I'd like this function to be immutable so
it can be used as a check constraint.

Kind regards,

Cochise Ruhulessin

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: SCALE goes to 11, and so does PostgreSQL!
Следующее
От: Joe Van Dyk
Дата:
Сообщение: Avoiding duplication of code via views -- slower? How do people typically do this?