Potential issue with pgAgent when updating pga_jobsteplog

From: "Benjamin Krajmalnik" <kraj(at)illumen(dot)com>
To: <pgadmin-support(at)postgresql(dot)org>
Subject: Potential issue with pgAgent when updating pga_jobsteplog
Date: 2008-05-05 15:57:22
Message-ID: F4E6A2751A2823418A21D4A160B689880E985D@fletch.stackdump.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

I have a scehduled job which randomizes a column inside a table.
The query is as follows:

update tbllocations set randsort=random();

Every time the job runs, it performs its task properly without any
issues, but I kept seeing the job as failed, and if you view the
statistics on the jon it shous as running.
Checking the PostgreSQL log file, I found the reason why it is showing
as still running.
The query which updates pga_jobsteplog is failing.

The query which is being issued is:

UPDATE pgagent.pga_jobsteplog SET jslduration=now()-jslstart,
jslresult=81961, jslstatus='s', jsloutput='' WHERE jslid=2890
The error being generated is "smallint out of range".
Apparently the jslresult column is a smallint, and the query is
returning the number of rows affected.

I believe one of 2 things probably needs to be done:

1. Update the documentation to mention what range the result needs to
be. This means that queries which affect many rows need to be
encapsulated in a stored procedure or have a supplementary query such as
"select 1" added to the step in order to return an in-range value
2. Change jslresult to a data type which will accomodate a larger
value.

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2008-05-06 10:57:16 Re: Potential issue with pgAgent when updating pga_jobsteplog
Previous Message Dave Page 2008-05-03 20:24:14 Re: Grant RULE removed in pg 8.2