[Reconnoiter-devel] [reconnoiter commit] r460 - trunk/sql

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Fri Sep 26 17:14:54 EDT 2008


Author: denish
Date: 2008-09-26 17:14:54 -0400 (Fri, 26 Sep 2008)
New Revision: 460

Modified:
   trunk/sql/reconnoiter_ddl_dump.sql
Log:
Modified function and trigger for saved_graphs as it was messing up with search results

Modified: trunk/sql/reconnoiter_ddl_dump.sql
===================================================================
--- trunk/sql/reconnoiter_ddl_dump.sql	2008-09-26 15:16:42 UTC (rev 459)
+++ trunk/sql/reconnoiter_ddl_dump.sql	2008-09-26 21:14:54 UTC (rev 460)
@@ -708,11 +708,11 @@
 DECLARE
  BEGIN
  IF TG_OP != 'INSERT' THEN
-   IF (NEW.graphid <> OLD.graphid) THEN
-           UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid);
+   IF (NEW.graph_tags <> OLD.graph_tags) THEN
+           UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid) where graphid=NEW.graphid;
    END IF;    
  ELSE 
-    UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid);
+    UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid) where graphid=NEW.graphid;
  END IF;  
    RETURN NEW;
 END
@@ -1992,10 +1992,12 @@
  BEGIN
  IF TG_OP != 'INSERT' THEN
    IF (NEW.metric_name <> OLD.metric_name) THEN
-           UPDATE stratcon.metric_name_summary SET ts_search_all=stratcon.metric_name_summary_tsvector(NEW.sid,NEW.metric_name,NEW.metric_type);
+           UPDATE stratcon.metric_name_summary SET ts_search_all=stratcon.metric_name_summary_tsvector(NEW.sid,NEW.metric_name,NEW.metric_type)
+             where sid=NEW.sid and metric_name=NEW.metric_name and metric_type = NEW.metric_type;
    END IF;    
  ELSE 
-    UPDATE stratcon.metric_name_summary SET ts_search_all=stratcon.metric_name_summary_tsvector(NEW.sid,NEW.metric_name,NEW.metric_type);
+    UPDATE stratcon.metric_name_summary SET ts_search_all=stratcon.metric_name_summary_tsvector(NEW.sid,NEW.metric_name,NEW.metric_type)
+            where sid=NEW.sid and metric_name=NEW.metric_name and metric_type = NEW.metric_type;
  END IF;  
    RETURN NEW;
 END



More information about the Reconnoiter-devel mailing list