pgAgent reports failure upon success - Mailing list pgadmin-support

From Martin French
Subject pgAgent reports failure upon success
Date
Msg-id OF5295D30C.C7B6378E-ON80257A33.00253BCF-80257A33.0026D802@LocalDomain
Whole thread Raw
Responses Re: pgAgent reports failure upon success
List pgadmin-support
<p><font face="sans-serif" size="2">pgAgent is reporting that the job running this query:</font><br /><br /><font
face="sans-serif"size="2"> insert into dba.pg_stat_bgwriter_data</font><br /><font face="sans-serif" size="2">
(</font><br/><font face="sans-serif" size="2"> select *, now() from pg_catalog.pg_stat_bgwriter</font><br /><font
face="sans-serif"size="2"> );</font><br /><br /><font face="sans-serif" size="2">is failing with a return code of 1,
despitehaving completed the insert ok.</font><br /><br /><font face="sans-serif" size="2">When I wrap the code in a
"do"statement, it reports success:</font><br /><br /><font face="sans-serif" size="2"> do $$</font><br /><font
face="sans-serif"size="2"> begin</font><br /><font face="sans-serif" size="2"> insert into
dba.pg_stat_bgwriter_data</font><br/><font face="sans-serif" size="2"> (</font><br /><font face="sans-serif" size="2">
select*, now() from pg_catalog.pg_stat_bgwriter</font><br /><font face="sans-serif" size="2"> );</font><br /><font
face="sans-serif"size="2"> end;</font><br /><font face="sans-serif" size="2"> $$ language plpgsql</font><br /><br /><br
/><fontface="sans-serif" size="2">I've been through the code, and the return of 1 is coming back from the number of
rowsinserted after ExecuteVoid so the logic following in job.cpp seems incorrect:</font><br /><br /><font
face="sans-serif"size="2">                wxString stepstatus;</font><br /><font face="sans-serif" size="2">           
   if (rc == 0)</font><br /><font face="sans-serif" size="2">                        stepstatus = wxT("s");</font><br
/><fontface="sans-serif" size="2">                else</font><br /><font face="sans-serif" size="2">                   
   stepstatus = steps->GetString(wxT("jstonerror"));</font><br /><br /><font face="sans-serif" size="2">"rc" is
comingback as the number of rows, so in this case; 1. I assume because the "do" statement returns 0 it's reporting
ok.</font><br/><br /><font face="sans-serif" size="2">pgAgent Version is:  pgAgent-3.2.0</font><br /><font
face="sans-serif"size="2">OS is: CentOS 6.2</font><br /><font face="sans-serif" size="2">Jobs ran from: pgAdmin
1.14.3</font><br/><br /><font face="sans-serif" size="2">If it's agreed that this is a bug, then I will have a go at a
patchif I get time later today...</font><br /><br /><font face="sans-serif" size="2">Cheers</font><br /><br /><font
face="sans-serif"size="2">Martin</font><br /><br /><font
face="sans-serif">=============================================Romax Technology Limited Rutherford House Nottingham
Science& Technology Park Nottingham, NG7 2PZ England Telephone numbers: +44 (0)115 951 88 00 (main) For other
officelocations see: http://www.romaxtech.com/Contact ================================= =============== E-mail:
info@romaxtech.comWebsite: www.romaxtech.com ================================= ================ Confidentiality
StatementThis transmission is for the addressee only and contains information that is confidential and privileged.
Unlessyou are the named addressee, or authorised to receive it on behalf of the addressee you may not copy or use it,
ordisclose it to anyone else. If you have received this transmission in error please delete from your system and
contactthe sender. Thank you for your cooperation. =================================================</font> 

pgadmin-support by date:

Previous
From: Michael Shapiro
Date:
Subject: Re: saved passwords deleted
Next
From: Vision Software Solutions
Date:
Subject: Posgres 9.1.4