Re: GENERATE AS

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: GENERATE AS
Дата
Msg-id 4108564.1687468505@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: GENERATE AS  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы GENERATE AS  ("Wetmore, Matthew (CTR)" <Matthew.Wetmore@express-scripts.com>)
Список 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 по дате отправления:

Предыдущее
От: Ron
Дата:
Сообщение: Re: GENERATE AS
Следующее
От: "Wetmore, Matthew (CTR)"
Дата:
Сообщение: GENERATE AS