Skip to content

pg_cron_helper

Extension to help functionality of pg_cron

pg_cron_helper · Extension to help functionality of pg_cron

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101528pg_cron_helperpg_cron_helper0.3TIMEGPL-3.0SQL
Relationships
Requiresdblink postgres_fdw

Usage

Sources:

pg_cron_helper — The pg_cron_helper database extension is supposed to help running “jobs” on a simple time-based schedule. Of course you are far better of using an external scheduler, but if you must schedule jobs inside a Postgres database then this extension may be of some help. Use it for the corresponding scheduling, temporal, or time-series workflow. Its extension dependencies must be installed and validated first.

Core Workflow

CREATE EXTENSION pg_cron_helper;

select * from  cron.list_jobs();

Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.

Important Objects

  • get_job_state(job_name varchar(128) , user_name name default current_user) is an extension function and returns text.
  • list_jobs() is an extension function and returns setof.
  • create_job is an extension procedure.
  • cron.stop_job is an extension procedure.
  • disable_job is an extension procedure.
  • drop_job is an extension procedure.
  • enable_job is an extension procedure.
  • run_job is an extension procedure.
  • stop_job is an extension procedure.
  • job_record is an extension-defined type.
  • job_definition is a table installed or managed by the extension.
  • job_run is a table installed or managed by the extension.

Requirements and Caveats

  • The reviewed control file declares default version 0.3.
  • Install the confirmed extension dependencies first: postgres_fdw, dblink.
  • The control file marks the extension as non-relocatable.
  • The control file requires a superuser for installation.
  • Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.

Table reader