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

SVN Commit by dpage: r4217 - trunk/pgadmin3/xtra/pgagent

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4217 - trunk/pgadmin3/xtra/pgagent
Date: 2005-05-19 10:06:30
Message-ID: 200505191006.j4JA6UE9011836@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
Author: dpage
Date: 2005-05-19 11:06:30 +0100 (Thu, 19 May 2005)
New Revision: 4217

Modified:
   trunk/pgadmin3/xtra/pgagent/job.cpp
   trunk/pgadmin3/xtra/pgagent/pgagent.sql
Log:
Include the step id in the step log

Modified: trunk/pgadmin3/xtra/pgagent/job.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/job.cpp	2005-05-19 09:53:11 UTC (rev 4216)
+++ trunk/pgadmin3/xtra/pgagent/job.cpp	2005-05-19 10:06:30 UTC (rev 4217)
@@ -81,17 +81,19 @@
     while (steps->HasData())
     {
         DBconn *conn;
-        string jslid, jpecode;
+        string jslid, stepid, jpecode;
 
+        stepid = steps->GetString("jstid");
+        
 		DBresult *id=serviceConn->Execute(
 			"SELECT nextval('pgagent.pga_jobsteplog_jslid_seq') AS id");
 		if (id)
 		{
 			jslid=id->GetString("id");
 			DBresult *res=serviceConn->Execute(
-				"INSERT INTO pgagent.pga_jobsteplog(jslid, jsljlgid, jslstatus) "
-				"SELECT " + jslid + ", " + logid + ", 'r'"
-				"  FROM pgagent.pga_jobstep WHERE jstid=" + steps->GetString("jstid"));
+				"INSERT INTO pgagent.pga_jobsteplog(jslid, jsljlgid, jsljstid, jslstatus) "
+				"SELECT " + jslid + ", " + logid + ", " + stepid + ", 'r'"
+				"  FROM pgagent.pga_jobstep WHERE jstid=" + stepid);
 
 			if (res)
 			{
@@ -116,7 +118,7 @@
                 conn=DBconn::Get(steps->GetString("jstdbname"));
                 if (conn)
                 {
-                    LogMessage("Executing step " + steps->GetString("jstid") + " on database " + steps->GetString("jstdbname"), LOG_DEBUG);
+                    LogMessage("Executing step " + stepid + " on database " + steps->GetString("jstdbname"), LOG_DEBUG);
                     rc=conn->ExecuteVoid(steps->GetString("jstcode"));
                 }
                 else

Modified: trunk/pgadmin3/xtra/pgagent/pgagent.sql
===================================================================
--- trunk/pgadmin3/xtra/pgagent/pgagent.sql	2005-05-19 09:53:11 UTC (rev 4216)
+++ trunk/pgadmin3/xtra/pgagent/pgagent.sql	2005-05-19 10:06:30 UTC (rev 4217)
@@ -127,6 +127,7 @@
 CREATE TABLE pgagent.pga_jobsteplog (
 jslid                serial               NOT NULL PRIMARY KEY,
 jsljlgid             int4                 NOT NULL REFERENCES pgagent.pga_joblog (jlgid) ON DELETE CASCADE ON UPDATE RESTRICT,
+jsljstid             int4                 NOT NULL REFERENCES pgagent.pga_jobstep (jstid) ON DELETE CASCADE ON UPDATE RESTRICT,
 jslstatus            char                 NOT NULL CHECK (jslstatus IN ('r', 's', 'i', 'f')) DEFAULT 'r', -- running, success, ignored, failed
 jslresult            int2                 NULL,
 jslstart             timestamptz          NOT NULL DEFAULT current_timestamp,


pgadmin-hackers by date

Next:From: svnDate: 2005-05-19 10:30:28
Subject: SVN Commit by dpage: r4218 - in trunk/pgadmin3/src/agent: . include
Previous:From: svnDate: 2005-05-19 09:53:11
Subject: SVN Commit by dpage: r4216 - trunk/pgadmin3/xtra/pgagent

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