Re: BUG #17036: generated column cann't modifyed auto when update - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #17036: generated column cann't modifyed auto when update
Date
Msg-id CAKFQuwbDwpPyf=q-LPUfhiLYHhM_2X_86vXL=tQ0vESivtcN7g@mail.gmail.com
Whole thread Raw
In response to Re:Re: BUG #17036: generated column cann't modifyed auto when update  (德哥 <digoal@126.com>)
Responses Re:Re: BUG #17036: generated column cann't modifyed auto when update  (德哥 <digoal@126.com>)
List pgsql-bugs
On Wednesday, May 26, 2021, 德哥 <digoal@126.com> wrote:

The generated column can be used to automatically generate the modified timestamp of a tuple, but PG 12 currently supports this scenario. PG 13 has started to change its behavior, which makes our application need to be modified. This is the first time I have ever seen a PG upgrade kill a nice feature.



It was never a feature in the first place so nothing has been killed.  The documentation says the function must be immutable.  Your function is not.  You should have used a trigger, and the fact you had to write a wrapper function to hack the volatility means that, frankly, its your disregard for a known limitation that has produced this need to change your application with the release of a new major version - not any bug or decision on the part of PostgreSQL.

David J.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17036: generated column cann't modifyed auto when update
Next
From: Tom Lane
Date:
Subject: Re: BUG #17035: assert after commit