Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Pgadmin Support > Potential issue...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 2011 of 2083
Post > Topic >>

Potential issue with pgAgent when updating pga_jobsteplog

by kraj@[EMAIL PROTECTED] ("Benjamin Krajmalnik") May 5, 2008 at 09:57 AM

This is a multi-part message in MIME format.

------_=_NextPart_001_01C8AEC8.B475BC14
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I have a scehduled job which randomizes a column inside a table.
The query is as follows:
=20
update tbllocations set randsort=3Drandom();
=20
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.
=20
The query which is being issued is:
=20
UPDATE pgagent.pga_jobsteplog SET jslduration=3Dnow()-jslstart,
jslresult=3D81961, jslstatus=3D's', jsloutput=3D'' WHERE jslid=3D2890
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.
=20
I believe one of 2 things probably needs to be done:
=20
1.  Update the do***entation 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.

------_=_NextPart_001_01C8AEC8.B475BC14
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.3314" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>I have =
a scehduled=20
job which randomizes a column inside a table.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>The =
query is as=20
follows:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D425322115-05052008></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>update =
tbllocations=20
set randsort=3Drandom();</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D425322115-05052008></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>Every =
time the job=20
runs, it performs its task properly without any issues, but I kept =
seeing the=20
job as failed, and if you view the statistics on the jon it shous as=20
running.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D425322115-05052008>Checking the=20
PostgreSQL log file, I found the reason why it is showing as still=20
running.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>The =
query which=20
updates pga_jobsteplog is&nbsp;failing.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D425322115-05052008></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>The =
query which is=20
being issued is:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D425322115-05052008></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>UPDATE =

pgagent.pga_jobsteplog SET jslduration=3Dnow()-jslstart, =
jslresult=3D81961,=20
jslstatus=3D's', jsloutput=3D'' WHERE jslid=3D2890</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>The =
error being=20
generated is "smallint out of range".</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D425322115-05052008>Apparently the=20
jslresult column is a smallint, and the query is returning the number of =
rows=20
affected.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D425322115-05052008></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D425322115-05052008>I =
believe one of 2=20
things probably needs to be done:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D425322115-05052008></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D425322115-05052008>1.&nbsp; Update the=20
do***entation to mention what range the result needs to be.&nbsp; This =
means=20
that queries which affect many rows need to be encapsulated in a stored=20
procedure or have a supplementary query such as "select 1" added to the =
step in=20
order to return an in-range value</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D425322115-05052008>2.&nbsp; Change=20
jslresult to a data type which will accomodate a larger=20
value.</SPAN></FONT></DIV></BODY></HTML>

------_=_NextPart_001_01C8AEC8.B475BC14--
 




 5 Posts in Topic:
Potential issue with pgAgent when updating pga_jobsteplog
kraj@[EMAIL PROTECTED] (  2008-05-05 09:57:22 
Re: Potential issue with pgAgent when updating pga_jobsteplog
dpage@[EMAIL PROTECTED]   2008-05-06 11:57:16 
Re: Potential issue with pgAgent when updating pga_jobsteplog
kraj@[EMAIL PROTECTED] (  2008-05-06 12:53:05 
Re: Potential issue with pgAgent when updating pga_jobsteplog
dpage@[EMAIL PROTECTED]   2008-05-06 20:15:26 
Re: Potential issue with pgAgent when updating pga_jobsteplog
dpage@[EMAIL PROTECTED]   2008-05-07 08:05:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 7:09:46 CDT 2008.