mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-14 17:43:34 +08:00
In #6767 we introduced the ability to track job execution history including succeeded and failed jobs. The new metadata table `_timescaledb_internal.bgw_job_stat_history` has two JSONB columns `config` (store config information) and `error_data` (store the ErrorData information). The problem is that this approach is not flexible for future history recording changes so this PR refactor the current implementation to use only one JSONB column named `data` that will store more job information in that form: { "job": { "owner": "fabrizio", "proc_name": "error", "scheduled": true, "max_retries": -1, "max_runtime": "00:00:00", "proc_schema": "public", "retry_period": "00:05:00", "initial_start": "00:05:00", "fixed_schedule": true, "schedule_interval": "00:00:30" }, "config": { "bar": 1 }, "error_data": { "domain": "postgres-16", "lineno": 841, "context": "SQL statement \"SELECT 1/0\"\nPL/pgSQL function error(integer,jsonb) line 3 at PERFORM", "message": "division by zero", "filename": "int.c", "funcname": "int4div", "proc_name": "error", "sqlerrcode": "22012", "proc_schema": "public", "context_domain": "plpgsql-16" } }