Is it somehow possible in postgres 12 to trigger an event when a table with an tsrange column crosses now(), or someone insert something that where the tsrange is prior to now()?

Triggers, as far i know, only triggers when someone insert or updates a row.

Triggering when someone insert a row which has passed now, seem to doable With trigger that triggers on all inserts, but i am not sure how to trigger an event, when a given timestamp in that row crosses now..

And can both trigger scenarios be combined into one?


1 Answer 1


You'd have to schedule a program to run regularly and process the table.

Usually it is better to implement such logic in the SELECT statements.

  • So there is no way of making the database notfy the application connected to it, that an event has occured?
    – lamda
    Apr 20, 2021 at 16:26
  • Time passing is no event. Apr 20, 2021 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.