Scheduling Jobs Using pg_cron
In this section, you’ll use the pg_cron[245] extension to schedule jobs in your database. This extension has wide support on PostgreSQL hosting providers.
Since the owner user you normally work with is not a superuser, you’ll connect to the rideshare_database as the superuser postgres to enable the extension. You’ll also grant the USAGE privilege to the cron schema for the owner role so that the owner user can call functions from the extension. Owners can work with functions and objects within the rideshare_development database. Refer to the pg_cron section of db/README.md in Rideshare for the latest information.
Before diving into all of that, you’ll need to set up pg_cron for macOS. While there is a Homebrew ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access