Fri Dec 4 2026 - Version 2.1.0

This is a maintenance release to fix issues since last release.

  - Count scheduler and job workers in the TAP cluster's pg_stat_activity.
    Thanks to Feng Ruohang for the patch.

  - Restart the scheduler when it is terminated while the server is running.
    The scheduler exited with code 0 on SIGTERM, which unregisters the
    background worker. After a pg_terminate_backend() or a DROP DATABASE
    ... WITH (FORCE) on the jobs database no job was executed anymore
    until the next server restart. Exit with code 1 so that the postmaster
    restarts it after bgw_restart_time, the postmaster never restarts
    background workers during a server shutdown.

Sat Apr 18 2026 - Version 2.0.0

This major release is a rewrite of the Perl scheduler into a PostgreSQL
background worker written in C and some other improvements.

  - Rewrite scheduler Perl external daemon into a background worker in C.
    Thanks to Eric-zch for the feature request.
  - Add github compilation testing workflow.
  - Fix documentation for use of background worker and change in table
    dbms_job.all_scheduler_job_run_details.
  - Remove obsolete perl program and configuration file.
  - Add naptime configuration parameter to change default value of 100 ms.
    Thanks to Pavel Seleznev for the patch.
  - Ability to set decimal value for job_queue_interval. Thanks to Pavel
    Seleznev for the patch.
  - Precise unit for run_duration column. Thanks to Omri Beck for the report.
  - Set $pg_dbms_job$ as a block for job execution to avoid conflict with
    the code executed. Thanks to nettrash for the patch.
  - Fix regression tests failing with PG15. Thanks to HelloYJohn for the report.


Sun Oct 02 2022 - Version 1.5.0

This release is maintenance release to fix one major issue.

  - Fix get_scheduled_jobs() to avoid executing already running jobs if it
    takes longer to complete than the frequency at which it is programmed.
    Thanks to Petru Ghita for the report.

Tue Aug 22 2022 - Version 1.4.0

This release is maintenance release to fix two major issues.

  - Fix function dbms_job.interval() that was not using dybnamic SQL
    for the UPDATE statement. Thanks to Eric-zch for the report.
  - Fix installation of extension's update files that was not copied
    in the right place.

Tue Aug 16 2022 - Version 1.3.0

This release is maintenance release since last release to fix issues
reported by users.

  - Fix extension file and regression test to remove the creation of
    the extension's schema if it not exist per CVE-2022-2625.
  - Fix case where pg_dbms_job does not run job anymore after a PG
    restart.  Thanks to longforrich for the patch.

Mon Apr 11 2022 - Version 1.2.0

This release is maintenance release since last release to fix issues
reported by users since the past height months. It also adds some
improvements.

  * Add configuration directive job_queue_processes to control the
    maximum number of job processed at the same time.
  * Keep entries in the jobs table to be able to monitor the duration
    of a task. Thank to Jagrab3 for the patch.
  * Allow strftime() escapes in log filename, for example to have a
    log file per week day use %a in the file name.
  * Add new configuration directive log_truncate_on_rotation to truncate file
    on rotation. When activated an existing log file with the same name as the
    new log file will be truncated rather than appended to. But such truncation
    only occurs on time-driven rotation, not on restarts.
    Thanks to K RamaKrishna Sastry for the feature request.
  * Allow pg_dbms_job to run on a standby server without reporting error.
    The daemon detects that it is running on a standby and disconnect
    immediately, it will try to connect 3 seconds later. Thanks to
    K RamaKrishna Sastry for the feature request.
  * Try to reconnect PostgreSQL after 3 seconds when the connection fail.
    Thanks to K RamaKrishna Sastry for the report.

Here is the complete list of other changes:

  - Fix an extract comma that make the update on failure fail.
  - Fix single execution mode with lasted change on connection error and
    update regression tests configuration file.
  - Prevent removing the pid file if pg_dbms_job can't find the
    configuration file and the -k option is used.
  - Do not die on error when pg_dbms_job reload the configuration file.
  - Explain the behavior of the update done on table dbms_job.all_scheduled_jobs
    after a job completion when it fails or it is successful.

Sat Aug 28 2021 - Version 1.1.0

This release is maintenance release since last release to fix some
possible wrong behaviors, control other ones and improve documentation.

 - Add configuration directive job_queue_processes to control the limit
   of jobs that can be run at the same time.
 - Fix insertion failure in job history table when PQSTATUS returned
   contains single quote.
 - Fix possible case where asynchronous jobs can be executed twice
   if they are not removed fast enough from the queue.
 - Fix regression test to use latest SQL version of the extension.
 - Add limitations on pg_dbms_job use and especially about the NOTIFY
   queue size limits. Thanks to Julien Rouhaud for the report.
 - Add missing information on how to stop or reload configuration of
   the scheduler.
 - Add information that unlike with cron-like scheduler, when the scheduler
   starts it executes all active jobs with a next date in the past.
 - Add information that jobs are executed with the role that has submitted
   the job and with the search path was used at job creation time.

To upgrade installed pg_dbms_job version 1.0.1 execute:

    ALTER EXTENSION pg_dbms_job UPDATE;

after installing the new version using: make && sudo make install


Wed Aug 25 2021: Version 1.0.1

  - Fix CREATE EXTENSION that was broken.

Wed Aug 25 2021: Version 1.0.0

  - Initial release

