Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns.

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns.
Дата
Msg-id
1028095.1664665480@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Bug / Unintentional Feature: non-immutable functions can be used for generated columns. Shane Plesner <gebnar@gmail.com>
Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns. "David G. Johnston" <david.g.johnston@gmail.com>
Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns. Shane Plesner <gebnar@gmail.com>
Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns. Tom Lane <tgl@sss.pgh.pa.us>
Shane Plesner  writes:
> It seems to me that any time a function is replaced, there could be a check
> to see if it was changed from immutable to mutable. If it was, check the
> schema for any references to that function that require immutable function
> calls, and raise an exception.
> Is there something I'm missing that makes this unfeasible?

Cost, added maintenance burden, race conditions.

Also, just complaining about dropping the immutability flag seems
rather pointless.  If you redefine the function in a way that changes its
results, but continue to mark it immutable, you've still broken a lot
of situations (e.g., expression indexes that depend on the function's
results).  If memory serves, we've actually discussed refusing any
alterations at all of an "immutable" function once it's defined.
But that's still not much help, because we can't usefully verify that
an "immutable" function's behavior actually is immutable.  In the end
it's on the user to preserve its behavior, or do appropriate cleanup
(such as reindexing) after a change.

			regards, tom lane


В списке pgsql-bugs по дате отправления
От: Jeff Janes
Дата:
От: Michael Paquier
Дата:
FAQ