Re: How to ensure a log-entry is created based on state of data in other tables

Andreas Joseph Krogh <andreas@visena.com>

From: Andreas Joseph Krogh <andreas@visena.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: pgsql-sql@lists.postgresql.org
Date: 2023-02-09T16:59:03Z
Lists: pgsql-sql

På torsdag 09. februar 2023 kl. 17:44:25, skrev David G. Johnston <
david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>>:


On Thu, Feb 9, 2023 at 12:24 AM Andreas Joseph Krogh <andreas@visena.com 
<mailto:andreas@visena.com>> wrote:


Is there a better way, using some extra tables to do bookkeeping can the have 
constraints ensuring this business-requirement?





Every time an activity newly becomes "Not Done" increment a "not done seen 
counter" and likewise with a "done seen counter". Whenever the former is 
greater than the later you have one or more not done activities.

David J.

Ah, this is what I'm looking for, I think.






--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas@visena.com <mailto:andreas@visena.com>
www.visena.com <https://www.visena.com>
 <https://www.visena.com>