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

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Mon Oct 13 17:12:30 EDT 2008


Author: denish
Date: 2008-10-13 17:12:29 -0400 (Mon, 13 Oct 2008)
New Revision: 472

Modified:
   trunk/sql/reconnoiter_ddl_dump.sql
Log:
another fix for saved graph serach

Modified: trunk/sql/reconnoiter_ddl_dump.sql
===================================================================
--- trunk/sql/reconnoiter_ddl_dump.sql	2008-10-13 18:13:40 UTC (rev 471)
+++ trunk/sql/reconnoiter_ddl_dump.sql	2008-10-13 21:12:29 UTC (rev 472)
@@ -705,6 +705,23 @@
 ALTER FUNCTION prism.saved_graphs_tsvector(in_graphid uuid) OWNER TO reconnoiter;
 
 --
+-- Name: trig_before_tsvector_saved_graphs(); Type: FUNCTION; Schema: prism; Owner: postgres
+--
+
+CREATE FUNCTION trig_before_tsvector_saved_graphs() RETURNS trigger
+    AS $$
+DECLARE
+ BEGIN
+   NEW.ts_search_all:= to_tsvector(NEW.title);
+     RETURN NEW;
+ END
+$$
+    LANGUAGE plpgsql;
+
+
+ALTER FUNCTION prism.trig_before_tsvector_saved_graphs() OWNER TO postgres;
+
+--
 -- Name: trig_update_tsvector_saved_graphs(); Type: FUNCTION; Schema: prism; Owner: reconnoiter
 --
 
@@ -712,13 +729,9 @@
     AS $$
 DECLARE
  BEGIN
- IF TG_OP != 'INSERT' THEN
    IF (NEW.graph_tags <> OLD.graph_tags OR NEW.title <> OLD.title) 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) where graphid=(NEW.graphid);
- END IF;  
    RETURN NEW;
 END
 $$
@@ -2410,11 +2423,21 @@
 
 
 --
+-- Name: trig_before_tsvector_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter
+--
+
+CREATE TRIGGER trig_before_tsvector_saved_graphs
+    BEFORE INSERT ON saved_graphs
+    FOR EACH ROW
+    EXECUTE PROCEDURE trig_before_tsvector_saved_graphs();
+
+
+--
 -- Name: trig_update_tsvector_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter
 --
 
 CREATE TRIGGER trig_update_tsvector_saved_graphs
-    AFTER INSERT OR UPDATE ON saved_graphs
+    AFTER UPDATE ON saved_graphs
     FOR EACH ROW
     EXECUTE PROCEDURE trig_update_tsvector_saved_graphs();
 



More information about the Reconnoiter-devel mailing list