pgAgent reports failure upon success

From: "Martin French" <Martin(dot)French(at)romaxtech(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: pgAgent reports failure upon success
Date: 2012-07-06 07:04:17
Message-ID: OF5295D30C.C7B6378E-ON80257A33.00253BCF-80257A33.0026D802@LocalDomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

<html><body><p><font size="2" face="sans-serif">pgAgent is reporting that the job running this query:</font><br><br><font size="2" face="sans-serif"> insert into dba.pg_stat_bgwriter_data</font><br><font size="2" face="sans-serif"> (</font><br><font size="2" face="sans-serif"> select *, now() from pg_catalog.pg_stat_bgwriter</font><br><font size="2" face="sans-serif"> );</font><br><br><font size="2" face="sans-serif">is failing with a return code of 1, despite having completed the insert ok.</font><br><br><font size="2" face="sans-serif">When I wrap the code in a &quot;do&quot; statement, it reports success:</font><br><br><font size="2" face="sans-serif"> do $$</font><br><font size="2" face="sans-serif"> begin</font><br><font size="2" face="sans-serif"> insert into dba.pg_stat_bgwriter_data</font><br><font size="2" face="sans-serif"> (</font><br><font size="2" face="sans-serif"> select *, now() from pg_catalog.pg_stat_bgwriter</font><br><font size="2" face="sans-serif"> );</font><br><font size="2" face="sans-serif"> end;</font><br><font size="2" face="sans-serif"> $$ language plpgsql</font><br><br><br><font size="2" face="sans-serif">I've been through the code, and the return of 1 is coming back from the number of rows inserted after ExecuteVoid so the logic following in job.cpp seems incorrect:</font><br><br><font size="2" face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wxString stepstatus;</font><br><font size="2" face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (rc == 0)</font><br><font size="2" face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stepstatus = wxT(&quot;s&quot;);</font><br><font size="2" face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</font><br><font size="2" face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stepstatus = steps-&gt;GetString(wxT(&quot;jstonerror&quot;));</font><br><br><font size="2" face="sans-serif">&quot;rc&quot; is coming back as the number of rows, so in this case; 1. I assume because the &quot;do&quot; statement returns 0 it's reporting ok.</font><br><br><font size="2" face="sans-serif">pgAgent Version is: &nbsp;pgAgent-3.2.0</font><br><font size="2" face="sans-serif">OS is: CentOS 6.2</font><br><font size="2" face="sans-serif">Jobs ran from: pgAdmin 1.14.3</font><br><br><font size="2" face="sans-serif">If it's agreed that this is a bug, then I will have a go at a patch if I get time later today...</font><br><br><font size="2" face="sans-serif">Cheers</font><br><br><font size="2" face="sans-serif">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 office locations see:
http://www.romaxtech.com/Contact
=================================
===============
E-mail: info(at)romaxtech(dot)com
Website: www.romaxtech.com
=================================

================
Confidentiality Statement
This transmission is for the addressee only and contains information that is confidential and privileged.
Unless you are the named addressee, or authorised to receive it on behalf of the addressee
you may not copy or use it, or disclose it to anyone else.
If you have received this transmission in error please delete from your system and contact the sender. Thank you for your cooperation.
=================================================</font>
</body></html>

Attachment Content-Type Size
unknown_filename text/html 3.7 KB

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Vision Software Solutions 2012-07-06 09:14:46 Posgres 9.1.4
Previous Message Michael Shapiro 2012-07-05 16:05:18 Re: saved passwords deleted