Open bsislow opened 3 months ago
why do multiple statements in one job only log the first statement's output in cron.job_run_details in return_message?
cron.job_run_details
return_message
example:
postgres=> create table a (b timestamp with time zone); CREATE TABLE postgres=> SELECT cron.schedule('* * * * *', $$select count(*) from a;insert into a select now();insert into a select now();$$); schedule ---------- 24 (1 row) postgres=> select * from a; b ------------------------------- 2024-08-20 14:10:00.068271+00 2024-08-20 14:10:00.068271+00 (2 rows) select * from cron.job_run_details order by end_time desc limit 1; jobid | runid | job_pid | database | username | command | status | return_message | start_time | end_time -------+-------+---------+-------------+-------------+---------------------------------------------------------------------------------+-----------+----------------+------------------------ -------+------------------------------- 25 | 664 | 11186 | postgres | postgres | select count(*) from a; insert into a select now(); insert into a select now(); | succeeded | INSERT 0 1 | 2024-08-20 14:10:00.010 36+00 | 2024-08-20 14:10:00.084913+00
we only see INSERT 0 1 here. this is restrictive when we're running a job that executes DELETEs that have child dependencies - in order, for example.
INSERT 0 1
DELETE
thanks.
why do multiple statements in one job only log the first statement's output in
cron.job_run_details
inreturn_message
?example:
we only see
INSERT 0 1
here. this is restrictive when we're running a job that executesDELETE
s that have child dependencies - in order, for example.thanks.