Khanh
Khanh

Reputation: 699

Postgresql trigger for when timestamp is reached

I'm building a table that stores user subscription details in Postgresql. Is there some sort of trigger function or event for when certain timestamp is reached? Example: User: A, Subscribed at: 17:00:00 11/01/2019, Expires in: 1 month Do postgresql supports something like setTimeout(1 month) or setInterval(1 month)?

I've read the postgres documentation on trigger which says that functions can be triggered only on operation (crud).

Upvotes: 0

Views: 1547

Answers (1)

A. Scherbaum
A. Scherbaum

Reputation: 855

There is pg_cron which can handle this kind of tasks.

Upvotes: 1

Related Questions