Re: BUG #17036: generated column cann't modifyed auto when update

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17036: generated column cann't modifyed auto when update
Дата
Msg-id 1684301.1622084940@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re:Re: BUG #17036: generated column cann't modifyed auto when update  (德哥 <digoal@126.com>)
Ответы Re:Re: BUG #17036: generated column cann't modifyed auto when update  (德哥 <digoal@126.com>)
Список pgsql-bugs
=?GBK?B?tcK45w==?= <digoal@126.com> writes:
> The generated column can be used to automatically generate the modified timestamp of a tuple, but PG 12 currently
supportsthis scenario. PG 13 has started to change its behavior, which makes our application need to be modified. This
isthe first time I have ever seen a PG upgrade kill a nice feature. 

You have been told several times already that this is not a "feature".
The point of the restriction that GENERATED expressions be immutable
is that the implementation need not recompute them during UPDATE
(if none of their input columns changed).

If v12 failed to exploit that fully, that's more a bug in v12 than
it is in versions that do exploit it.

If you need to update a column during every update, the best way
to do that is with a BEFORE INSERT OR UPDATE trigger.

I will also state categorically that lying about the mutability
of a function is a technique that will bite you on the rear, and
you will get no sympathy when it does.  If it does what you want
in version N, fine, but don't whine when it breaks in N+1.

            regards, tom lane



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

Предыдущее
От: RekGRpth
Дата:
Сообщение: Re: BUG #17035: assert after commit
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #17036: generated column cann't modifyed auto when update