Re: GENERATE AS

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: GENERATE AS
Дата
Msg-id CAKFQuwbgETyn7DoEBT3CzhZzwfhUa_Z=AGbhTGqqgn1=Vgsf7A@mail.gmail.com
обсуждение исходный текст
Ответ на GENERATE AS  ("Wetmore, Matthew (CTR)" <Matthew.Wetmore@express-scripts.com>)
Список pgsql-admin
On Thu, Jun 22, 2023 at 1:00 PM Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com> wrote:

Hi, I have this issue and now I’m just wasting time. Can you tell me what I’m doing wrong?


Like the error message says - you are trying to use a generated expression when one of the inputs is volatile (or, is not immutable).

It makes no sense to store "hours elapsed" when the concept of current time (an ever changing concept) is being used in the formula.  Create a view with you expression then the view can always provide an accurate value for elapsed time as of when the query is run.

David J.

В списке pgsql-admin по дате отправления:

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