Hey,

Ok, here is the patch to make the rewritten query work with PG as well (API call
'system.listLatestUpgradablePackages'). It's actually a follow up to this 
commit:

4823565b2e634bc73010d366ff82c432630bca85

It was strange though when testing it: for most of my systems it returned really
quick (with 0 results though), but I also had one system, where the query did 
not
return at all, even after 1 hour! You might want to do some additional 
performance
testing here. There was nothing special about this specific host though, it was
even subscribed to a base channel only..

Regards,
Johannes

-- 
SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
>From f48143d211baeb4161814ae5deb537aa57642c70 Mon Sep 17 00:00:00 2001
From: Johannes Renner <jren...@suse.de>
Date: Wed, 31 Oct 2012 12:18:02 +0100
Subject: [PATCH] Use braces for accessing composite types in PG

---
 .../rhn/common/db/datasource/xml/Package_queries.xml       |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
index 1198cef..29ab2cb 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
@@ -806,14 +806,14 @@ ORDER BY  UPPER(PN.name)
 <mode name="system_upgradable_package_list_no_errata_info">
   <query params="sid">
     SELECT  n.name,
-        NVL(sp.evr.epoch, ' ') as from_epoch,
-        NVL(sp.evr.version, ' ') as from_version,
-        NVL(sp.evr.release, ' ') as from_release,
+        NVL((sp.evr).epoch, ' ') as from_epoch,
+        NVL((sp.evr).version, ' ') as from_version,
+        NVL((sp.evr).release, ' ') as from_release,
         spa.label as from_arch,
         spa.label as arch,
-        NVL(up.evr.epoch, ' ') as to_epoch,
-        NVL(up.evr.version, ' ') as to_version,
-        NVL(up.evr.release, ' ') as to_release,
+        NVL((up.evr).epoch, ' ') as to_epoch,
+        NVL((up.evr).version, ' ') as to_version,
+        NVL((up.evr).release, ' ') as to_release,
         up.arch_label as to_arch,
         up.id as to_package_id
   FROM
-- 
1.7.10.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to