Re: pgAgent reports failure upon success

From: "Martin French" <Martin(dot)French(at)romaxtech(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-support(at)postgresql(dot)org,pgadmin-support-owner(at)postgresql(dot)org
Subject: Re: pgAgent reports failure upon success
Date: 2012-07-11 06:36:29
Message-ID: OFD2ABAB81.DF6CCFE4-ON80257A38.0023E9F0-80257A38.00244C9F@LocalDomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

<html><body><p><font size="2" face="sans-serif">Hi</font><br><br><tt><font size="2">pgadmin-support-owner(at)postgresql(dot)org wrote on 10/07/2012 16:05:18:<br><br>&gt; From: Dave Page &lt;dpage(at)pgadmin(dot)org&gt;</font></tt><br><tt><font size="2">&gt; To: Martin French &lt;Martin(dot)French(at)romaxtech(dot)com&gt;, </font></tt><br><tt><font size="2">&gt; Cc: pgadmin-support(at)postgresql(dot)org, pgadmin-support-owner(at)postgresql(dot)org</font></tt><br><tt><font size="2">&gt; Date: 10/07/2012 19:12</font></tt><br><tt><font size="2">&gt; Subject: Re: [pgadmin-support] pgAgent reports failure upon success</font></tt><br><tt><font size="2">&gt; Sent by: pgadmin-support-owner(at)postgresql(dot)org</font></tt><br><tt><font size="2">&gt; <br>&gt; On Tue, Jul 10, 2012 at 1:57 PM, Martin French<br>&gt; &lt;Martin(dot)French(at)romaxtech(dot)com&gt; wrote:<br>&gt; &gt; Hi<br>&gt; &gt;<br>&gt; &gt; Thanks for the feedback. I certainly won't be discouraged by it! :)<br>&gt; <br>&gt; :-)<br>&gt; <br>&gt; &gt;&gt; - You have member name of [Get|Set]LastResult which set/return a<br>&gt; &gt;&gt; member variable called lastStatus. These should be consistent to avoid<br>&gt; &gt;&gt; confusion.<br>&gt; &gt;<br>&gt; &gt; Will amend accordingly.<br>&gt; <br>&gt; Thanks.<br>&gt; <br>&gt; &gt;&gt; - Rather than setting lastStatus to 0 or -1, why not set it to<br>&gt; &gt;&gt; PQresultStatus(). That seems like it would be more useful in the<br>&gt; &gt;&gt; future (and potentially in the log files).<br>&gt; &gt;<br>&gt; &gt; I'd set it to only two values, as it made the comparison easier. As I see<br>&gt; &gt; it, ExecStatusType ENUM can be anyone of 0 - 8 inclusive, but some of those<br>&gt; &gt; are error messages, so it'd either have to determine which ones are OK and<br>&gt; &gt; which are not either with a case statement or with an extended &quot;if&quot;. Happy<br>&gt; &gt; to code that in along the lines of (or inverse, testing for fails...):<br>&gt; &gt;<br>&gt; &gt; switch (rc)<br>&gt; &gt; {<br>&gt; &gt; case PGRES_COMMAND_OK:<br>&gt; &gt; case PGRES_TUPLES_OK:<br>&gt; &gt; case PGRES_COPY_OUT:<br>&gt; &gt; case PGRES_COPY_IN:<br>&gt; &gt; case PGRES_COPY_BOTH:<br>&gt; &gt;<br>&gt; &gt; stepstatus = wxT(&quot;s&quot;);<br>&gt; &gt; break;<br>&gt; &gt; default:<br>&gt; &gt;<br>&gt; &gt; stepstatus = steps-&gt;GetString(wxT(&quot;jstonerror&quot;));<br>&gt; &gt; break<br>&gt; &gt; }<br>&gt; &gt;<br>&gt; &gt; If you think that's a more viable option? Let me know and I'll sort it :)<br>&gt; <br>&gt; That's a little more complex for this case, but I think it'll make the<br>&gt; dbconn class more useful for the future. You could of course wrap that<br>&gt; switch statement up in the class as well, and offer another public<br>&gt; member that returns a simple boolean indicating if the last status was<br>&gt; a success or failure.<br></font></tt><br><tt><font size="2">Agreed, I'll see what I can put together today (time permitting). </font></tt><br><br><tt><font size="2">&gt; <br>&gt; &gt;&gt; - When creating the diff, please use &quot;git diff&quot;, or if working from a<br>&gt; &gt;&gt; source tarball (not recommended for development) - take 2 copies and<br>&gt; &gt;&gt; then diff them, eg &quot;diff -c -r pgagent-src/ pgagent-src.orig/ &gt;<br>&gt; &gt;&gt; mypatch.diff&quot;. That'll put the entire patch in one file, which makes<br>&gt; &gt;&gt; it much easier to handle and reapply.<br>&gt; &gt;<br>&gt; &gt; I'm afraid I'm limited to source tarballs at the moment. Attempting to pull<br>&gt; &gt; from git gives me &quot;Connection Refused&quot;. So will create a single patch file<br>&gt; &gt; using the method suggested.<br>&gt; <br>&gt; Hmm, this works for me:<br>&gt; <br>&gt; git clone git://git.postgresql.org/git/pgagent.git<br>&gt; <br>&gt; or, if you're on a network that blocks the git protocol, you might <br>&gt; want to try:<br>&gt; <br>&gt; git clone <a href="http://git.postgresql.org/git/pgagent.git">http://git.postgresql.org/git/pgagent.git</a><br>&gt; <br>&gt; Please let me know if that doesn't work, as I'm one of the admins for<br>&gt; that server as well so obviously want to fix any problems.<br>&gt; </font></tt><br><tt><font size="2">The http link works now. I think the problem was this end, as it's a new VM I'm using, so is not configured perhaps as well as It should be!</font></tt><br><tt><font size="2"><br>Cheers</font></tt><br><br><tt><font size="2">Martin.</font></tt><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 5.2 KB

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Maada Moseray 2012-07-11 08:24:56 PLEASE UNSUBSCRIBE IMMEDIATELY
Previous Message Dave Page 2012-07-10 15:05:18 Re: pgAgent reports failure upon success