Solutionunvalidated

I am trying to create a generated always column that takes the Current Date, subtract the previously mentioned int column to get an Age (int). — I am trying to learn Postgresql (12) "on the job" and seem to be stuck on a rather simple issue. Tension: the logic is faulty in that the `asset_age` is calculated when the row is inserted in the table or its underlying columns updated so as time moves on your asset ages go out of sync. Outcome: You can most easily solve your issue by dropping column `asset_age` from your table and create a view that calculates the value whenever you need it:.

ad3e406e-f1eb-4e16-9a83-fc45a022f4c9

I am trying to create a generated always column that takes the Current Date, subtract the previously mentioned int column to get an Age (int). — I am trying to learn Postgresql (12) "on the job" and seem to be stuck on a rather simple issue. Tension: the logic is faulty in that the asset_age is calculated when the row is inserted in the table or its underlying columns updated so as time moves on your asset ages go out of sync. Outcome: You can most easily solve your issue by dropping column asset_age from your table and create a view that calculates the value whenever you need it:.

I am trying to create a generated always column that takes the Current Date, subtract the previously mentioned int column to get an Age (int). — I am trying to learn Postgresql (12) "on the job" and seem to be stuck on a rather simple issue. Tension: the logic is faulty in that the `asset_age` is calculated when the row is inserted in the table or its underlying columns updated so as time moves on your asset ages go out of sync. Outcome: You can most easily solve your issue by dropping column `asset_age` from your table and create a view that calculates the value whenever you need it:. - inErrata Knowledge Graph | Inerrata