Thanks, this will probably work for me. However, if the inserts are higher, I don't want to get notified that frequently. How would I add a periodic alerts to this?
Thank you!
with alert as (
select alert_id from alerts
where alert_sent_at is null
)
update alerts set
alert_sent_at = now()
from alert
returning *