Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgadmin-support by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group