Case:
A temporary record is inserted for a specific period of time (eg now() for the next 5 minutes).
If "appropriate action" takes place within defined period (eg now() + 2 minutes) then the record gets deleted through a delete statement.
If period ends, the record should get automatically deleted.
At first sight, I would like to solve this within DB space.
Possible solutions:
I have found two tools which may help; pg_cron and pgAgent. I am not sure if they would be set dynamically in real time, wouldn't they?
For example: (expired_time) et = now() + 10 minutes
SELECT cron.schedule('minutes(et) hours(et) * * *', $$DELETE FROM ... $$);
Note: Above syntax is indicative!
Is there any other way or tool to do that, always within DB?
Tia