pg_timetable is a PostgreSQL job scheduler developed by CYBERTEC. It offers cutting edge flexibility and a large variety of features.

Job scheduling is one of the most important topics in modern database management. In the PostgreSQL ecosystems, pgAgent and pg_cron have become quite popular. However, both tools have a fair amount of limitations. Hence, we have decided to release our own solution: Welcome pg_timetable, the next generation PostgreSQL job scheduler.

Why pg_timetable?

1. Reliable and stable architecture

2. Support for complex execution

  • Support for complex tasks chains
  • Ability to create modules
  • Sophisticated error handling
  • Support for transactional execution
  • Concurrency protection

3. Ability to execute different types of tasks

  • SQL scripts
  • Shell executables
  • Built in tasks (send mails, etc.)
  • self-destructive chains

1. Reliable and stable architecture

How pg_timetable works

pg_timetable is a simple, easy to run executable, which connects to PostgreSQL. It is not part of the server infrastructure itself. For this reason, it neither poses a security threat nor a stability concern to your server. It runs independently and is implemented as a simple, robust architecture.

pg_timetable: Advanced job scheduler

pg_timetable is 100% database driven and allows you to use PostgreSQL alone to control your workflows. All log is stored in the database and therefore, it is super easy to dissect logging information using plain SQL. You can also visualize data and execution logs fast and easily using a technology stack of your choice.

2. Support for complex execution

Execute complex workflows

Traditional job schedulers, such as cron or pg_cron, can either launch scripts or execute SQL. It seems to be very hard to combine those tasks, topping that of with problems of modularization. pg_timetable helps you to run those operations. “Base tasks” can be combined in a flexible way and entire “chains” can be executed on a regular basis which gives you a lot of flexibility.

PG_TIMETABLE: ADVANCED JOB SCHEDULING

PostgreSQL jobs and concurrency protection

Additionally, pg_timetable offers built in concurrency protection. This means that it prevents single jobs from keeping on launching themselves, while slowly killing your server. By using a simple flag, pg_timetable allows you to synchronize complex workflows.

PG_TIMETABLE: ADVANCED JOB SCHEDULING

Transaction jobs and error handling

Mostly, a job should run in a database transaction and should either fail or succeed entirely – nothing in between. pg_timetable is completely based on transactions. Therefore, it allows you to flexibly combine “base tasks” in single transactions which adds reliability and integrity to your task chains.

3. Ability to execute different types of tasks

Configuring pg_timetable “cron style”

In general pg_timetable can be configured using plain SQL. However, some people prefer cron-style configuration. In order to get you started quickly, pg_timetable also supports a cron-style configuration interface to make it easier to quickly configure jobs. This is especially useful if you want to run simple jobs. It will then translate your configuration to the more advanced pg_timetable way for you automatically.

Self-destructive chains

What if you want to schedule a task which should only be executed exactly once in case it is successful? For example, you want to delete a user in two weeks from now or send a reminder to a client only once. pg_timetable allows you to schedule self-destructive chains for exact those reasons very easily.

 

Contact us if you want to know more!

Download

pg_timetable is Open Source and can be used freely by everyone. You can download the source code from our GitHub page or use the Dockerfile if you want to directly run it in a container.

Download

As always, we encourage you to contribute to our Open Source solution and to send patches.