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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: 德哥 <digoal(at)126(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17036: generated column cann't modifyed auto when update
Date: 2021-05-27 02:33:40
Message-ID: CAKFQuwbkoz3zmL_bEC2ndSX5G9_3xm_+AL2fd+3OTFFH0VePow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wednesday, May 26, 2021, 德哥 <digoal(at)126(dot)com> wrote:

>
> And immutable function is stable when parameter not change, when parameter
> changed , the immutable function will recall and recompute.
> but in PG 13 and PG 14 , it is also wrong.
>
> ```
> create or replace function im_now (anyelement) returns timestamptz as $$
> select now();
> $$ language sql strict immutable;
>
> create table t1 (id int primary key, c1 int, info text, crt_time
> timestamp,
> mod_time timestamp GENERATED ALWAYS AS (im_now(t1)) stored);
>

This seems to be related to this already reported bug (the similar one I
noted in my other reply).

https://www.postgresql.org/message-id/CAM_DEiWR2DPT6U4xb-Ehigozzd3n3G37ZB1%2B867zbsEVtYoJww%40mail.gmail.com

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message 德哥 2021-05-27 02:45:45 Re:Re: BUG #17036: generated column cann't modifyed auto when update
Previous Message David G. Johnston 2021-05-27 02:23:01 Re: BUG #17036: generated column cann't modifyed auto when update