Crontab function scheduler in seconds timer

126 Views Asked by At

How to set any postgres function in crontab with frequency of seconds? Thank you in advance.

Tried searching for seconds timer scheduling. But looks like postgres / crontab doesn't support for seconds setup. only minute, hour, day, etc options are available. Looking for any alternative option.

1

There are 1 best solutions below

0
Albina On

If your PostgreSQL version is 10+ then you can use pg_cron extension to schedule scripts directly from the database.

As stated in the documentation,

... You can also use '[1-59] seconds' to schedule a job based on an interval.