timescaledb_information.jobs

Shows information about all jobs registered with the automation framework.

Arguments

NameTypeDescription
job_idINTEGERThe ID of the background job
application_nameTEXTName of the policy or user defined action
schedule_intervalINTERVALThe interval at which the job runs. Defaults to 24 hours
max_runtimeINTERVALThe maximum amount of time the job is allowed to run by the background worker scheduler before it is stopped
max_retriesINTEGERThe number of times the job is retried if it fails
retry_periodINTERVALThe amount of time the scheduler waits between retries of the job on failure
proc_schemaTEXTSchema name of the function or procedure executed by the job
proc_nameTEXTName of the function or procedure executed by the job
ownerTEXTOwner of the job
scheduledBOOLEANSet to true to run the job automatically
configJSONBConfiguration passed to the function specified by proc_name at execution time
next_startTIMESTAMP WITH TIME ZONENext start time for the job, if it is scheduled to run automatically
hypertable_schemaTEXTSchema name of the hypertable. Set to NULL for user-defined action
hypertable_nameTEXTTable name of the hypertable. Set to NULL for user-defined action
check_schemaTEXTSchema name of the optional configuration validation function, set when the job is created or updated
check_nameTEXTName of the optional configuration validation function, set when the job is created or updated

Sample use

Shows a job associated with the refresh policy for continuous aggregates:

  1. SELECT * FROM timescaledb_information.jobs;
  2. job_id | 1001
  3. application_name | Refresh Continuous Aggregate Policy [1001]
  4. schedule_interval | 01:00:00
  5. max_runtime | 00:00:00
  6. max_retries | -1
  7. retry_period | 01:00:00
  8. proc_schema | _timescaledb_internal
  9. proc_name | policy_refresh_continuous_aggregate
  10. owner | postgres
  11. scheduled | t
  12. config | {"start_offset": "20 days", "end_offset": "10
  13. days", "mat_hypertable_id": 2}
  14. next_start | 2020-10-02 12:38:07.014042-04
  15. hypertable_schema | _timescaledb_internal
  16. hypertable_name | _materialized_hypertable_2
  17. check_schema | _timescaledb_internal
  18. check_name | policy_refresh_continuous_aggregate_check

Find all jobs related to compression policies:

  1. SELECT * FROM timescaledb_information.jobs where application_name like 'Compression%';
  2. -[ RECORD 1 ]-----+--------------------------------------------------
  3. job_id | 1002
  4. application_name | Compression Policy [1002]
  5. schedule_interval | 15 days 12:00:00
  6. max_runtime | 00:00:00
  7. max_retries | -1
  8. retry_period | 01:00:00
  9. proc_schema | _timescaledb_internal
  10. proc_name | policy_compression
  11. owner | postgres
  12. scheduled | t
  13. config | {"hypertable_id": 3, "compress_after": "60 days"}
  14. next_start | 2020-10-18 01:31:40.493764-04
  15. hypertable_schema | public
  16. hypertable_name | conditions
  17. check_schema | _timescaledb_internal
  18. check_name | policy_compression_check

Find jobs that are run by user defined actions:

  1. SELECT * FROM timescaledb_information.jobs where application_name like 'User-Define%';
  2. -[ RECORD 1 ]-----+------------------------------
  3. job_id | 1003
  4. application_name | User-Defined Action [1003]
  5. schedule_interval | 01:00:00
  6. max_runtime | 00:00:00
  7. max_retries | -1
  8. retry_period | 00:05:00
  9. proc_schema | public
  10. proc_name | custom_aggregation_func
  11. owner | postgres
  12. scheduled | t
  13. config | {"type": "function"}
  14. next_start | 2020-10-02 14:45:33.339885-04
  15. hypertable_schema |
  16. hypertable_name |
  17. check_schema | NULL
  18. check_name | NULL
  19. -[ RECORD 2 ]-----+------------------------------
  20. job_id | 1004
  21. application_name | User-Defined Action [1004]
  22. schedule_interval | 01:00:00
  23. max_runtime | 00:00:00
  24. max_retries | -1
  25. retry_period | 00:05:00
  26. proc_schema | public
  27. proc_name | custom_retention_func
  28. owner | postgres
  29. scheduled | t
  30. config | {"type": "function"}
  31. next_start | 2020-10-02 14:45:33.353733-04
  32. hypertable_schema |
  33. hypertable_name |
  34. check_schema | NULL
  35. check_name | NULL