How to create a timed trigger in postgresql
I have a table in my database (postgres) that stores a user account in it. I need to create a trigger that will clean up in a specific amount of time (say 30 minutes.) Is it possible to do this from postgres, or do I need to use something else? (By anything else, I mean C or Java or any other programming language that can sleep for a certain amount of time).
+3
artaxerxe
source
to share
2 answers
You can use pgAgent to schedule events.
+3
Frank heikens
source
to share
Without PgAgent, things like this can be done with a cron script.
In both cases, the periodic thing will run from a different context (database owner, superuser, postgres) and in a separate transaction, obviously.
+3
wildplasser
source
to share