artaxerxe
artaxerxe

Reputation: 6411

How to create a time-driven trigger in postgresql

I have a table in my database (postgres), that keeps in it the user accounting trace. I need to create a trigger that will perform a clean up at a given amount of time (let's say 30 minutes.) Is it possible to do that from postgres, or do I need to use something else? (By something else I mean C or Java or any other programming language that can sleep for a given time).

Upvotes: 5

Views: 14400

Answers (1)

wildplasser
wildplasser

Reputation: 44240

Without PgAgent, things like this can be done using a cron script.

In both cases the periodic thing will be running from a different context (database owner, superuser, postgres), and in a separate transaction, obviously.

Upvotes: 3

Related Questions