I've a simple stored procedure which calculates values from 1 table and insert it in another. I want to schedule it to run once in a day.
I came across pg_cron but it looks like it will only work for version 9.5 and above.
How to to schedule this sp or it;s select statement select * from stored_procedure_name() in postgres
as mentioned by @AlexM I started looking in Cron and found few useful links to do this outside of postgresql.
crontab in linux with 20 useful examples helps me out in understanding the structure for creating a new entry in the crontab.
edit the crontab file and added the following entry in it. As it's in the same server so no need to pass credentials for the postgresql
00 00 * * * psql -c "select query here;"
Unfortunately, the previous comments are correct. There is no scheduler within PostgreSQL nor any of the supplied utilities. Your only option is to use an external scheduler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With