Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cron scheduling #357

Open
ramkly opened this issue Sep 23, 2024 · 1 comment
Open

cron scheduling #357

ramkly opened this issue Sep 23, 2024 · 1 comment

Comments

@ramkly
Copy link

ramkly commented Sep 23, 2024

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?

@TheOtherBrian1
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants