I am running self-hosted TimescaleDB. I created a function called trim_events
that will check hypertable size and delete old chunks if the size of the hypertable exceeds a certain threshold. I am trying to run it hourly using the add_job()
function.
The function itself works fine if I run it manually using SELECT trim_events();
from the psql console.
I created the job using SELECT add_job('trim_events', '1h');
. No problems there, it returns the job_id of 1008.
However, checking the job history, I can see that the job fails every time with cache lookup failed for function 0
. If I try to run the job with CALL run_job(1008);
, I get the same error.
How can I resolve this issue?