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

From 德哥
Subject Re:Re: BUG #17036: generated column cann't modifyed auto when update
Date
Msg-id 574cb2f7.4da8.179ad23f309.Coremail.digoal@126.com
Whole thread Raw
In response to Re: BUG #17036: generated column cann't modifyed auto when update  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs


Thank you Tom Lane for your reply. I think your explanation is very clear.

So can we talk about the use of volatile or stable functions in generated columns and if there are actual business scenarios, why not design the functionality from the perspective of the scenarios instead of the scenarios?




--公益是一辈子的事,I'm Digoal,Just Do It.



At 2021-05-27 11:09:00, "Tom Lane" <tgl@sss.pgh.pa.us> wrote: >德哥 <digoal@126.com> writes: >> 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. > >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 by date:

Previous
From: 德哥
Date:
Subject: Re:Re: BUG #17036: generated column cann't modifyed auto when update
Next
From: Dmitry Dolgov
Date:
Subject: Re: XX000: iso-8859-1 type of jsonb container.