Re: GENERATE AS - Mailing list pgsql-admin

From Tom Lane
Subject Re: GENERATE AS
Date
Msg-id 4108564.1687468505@sss.pgh.pa.us
Whole thread Raw
In response to Re: GENERATE AS  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses GENERATE AS
List pgsql-admin
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> The problem here is not timezone related - it is more fundamental in that
> the stored data does not change but the expression, as time progresses, is
> going to give different values and thus make what is stored incorrect.

Right --- current_timestamp in a generation expression makes no sense.
(There's also an issue about whether the surrounding calculation
is timezone-dependent, but that could be fixed up.  Depending on
current time cannot be.)

You could create a view in which this value is an extra computed column,
but you can't do it as a stored generated column.

            regards, tom lane



pgsql-admin by date:

Previous
From: Ron
Date:
Subject: Re: GENERATE AS
Next
From: "Wetmore, Matthew (CTR)"
Date:
Subject: GENERATE AS