cron scheduling
Hi, I have servers in different time zones, and I know that pg_cron schedules jobs by default in UTC. Is there any way to schedule jobs based on the server's local time zone instead of UTC?
You can view the cron settings by running:
SELECT * FROM pg_settings where name ilike '%cron%';
pg_cron can only run within one database in your cluster. You can change the default by running:
ALTER SYSTEM SET cron.timezone = '<timezone>';
Because it's a postmaster level setting, you'll have restart the cluster (pg_ctl). You can view valid timezones in the postgres docs
May be worth adding that pg_cron utilizes the standard postgres time zones in that link to the README. If that is in fact the exhaustive list, things like 'America/New_York' won't work. The current documentation is unclear