Search Postgresql Archives

Immutable functions, Exceptions and the Query Optimizer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux