\r
Date Dev Ver Change details\r
---------- --- ----- --------------\r
-2007-10-05 HS 1.8.0 Fixed new VIEW creation conditions.\r
+2007-10-12 DP 1.8.0 Avoid using a correlated subquery that Greenplum doesn't\r
+ support, per report from Jon Roberts.\r
2007-09-24 DP 1.8.0 Allow GUCs to be set on functions in PostgreSQL 8.3 and\r
- above [Guillaume Lelarge]\r
+ above. [Guillaume Lelarge]\r
2007-09-24 DP 1.8.0 Allow GUCs to be set on users, roles and databases at\r
create time.\r
2007-09-03 DP 1.8.0 Fix the table, index and index constraint tablespace\r
pgaJob *job=0;
pgSet *jobs= collection->GetConnection()->ExecuteSet(
- wxT("SELECT *, ")
- wxT("(SELECT jlgstatus FROM pgagent.pga_joblog jl WHERE jl.jlgjobid = j.jobid ORDER BY jlgid DESC LIMIT 1) AS joblastresult ")
- wxT("FROM pgagent.pga_job j\n")
- wxT(" JOIN pgagent.pga_jobclass cl ON cl.jclid=jobjclid\n")
- wxT(" LEFT OUTER JOIN pgagent.pga_jobagent ag ON ag.jagpid=jobagentid\n")
+ wxT("SELECT j.*, cl.*, ag.*, sub.jlgstatus ")
+ wxT(" FROM pgagent.pga_job j JOIN")
+ wxT(" pgagent.pga_jobclass cl ON cl.jclid=jobjclid LEFT OUTER JOIN")
+ wxT(" pgagent.pga_jobagent ag ON ag.jagpid=jobagentid JOIN")
+ wxT(" (SELECT DISTINCT ON (jlgjobid) jlgstatus, jlgjobid")
+ wxT(" FROM pgagent.pga_joblog")
+ wxT(" ORDER BY jlgjobid, jlgid desc) sub ON sub.jlgjobid = j.jobid ")
+ restriction +
- wxT(" ORDER BY jobname"));
+ wxT("ORDER BY jobname;"));
if (jobs)
{