itTech
itTech

Reputation: 346

Postgresql: Execute query every 12 midnight

Im using the latest postgres version and im new with it. I just want to know how can i have an insert query statement that triggers every midnight or using now()::time = '23:59:59'? is it possible? Thanks in advance

Upvotes: 0

Views: 1394

Answers (1)

Justin Niessner
Justin Niessner

Reputation: 245419

Postgres doesn't have anything out of the box to do what you need. You'll need something like pg_cron to allow you to schedule queries:

https://github.com/citusdata/pg_cron

Or schedule the query using psql via the system's cron scheduler.

Upvotes: 4

Related Questions