Changeset 9e9c974e402a479ebbc927ca69c82166708b2d80

Show
Ignore:
Timestamp:
10/13/08 21:12:29 (10 years ago)
Author:
Denish Patel <denish@omniti.com>
git-committer:
Denish Patel <denish@omniti.com> 1223932349 +0000
git-parent:

[04c2ba0f9a1814ea044e5060104e73817640055d]

git-author:
Denish Patel <denish@omniti.com> 1223932349 +0000
Message:

another fix for saved graph serach

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/reconnoiter_ddl_dump.sql

    r04c2ba0 r9e9c974  
    706706 
    707707-- 
     708-- Name: trig_before_tsvector_saved_graphs(); Type: FUNCTION; Schema: prism; Owner: postgres 
     709-- 
     710 
     711CREATE FUNCTION trig_before_tsvector_saved_graphs() RETURNS trigger 
     712    AS $$ 
     713DECLARE 
     714 BEGIN 
     715   NEW.ts_search_all:= to_tsvector(NEW.title); 
     716     RETURN NEW; 
     717 END 
     718$$ 
     719    LANGUAGE plpgsql; 
     720 
     721 
     722ALTER FUNCTION prism.trig_before_tsvector_saved_graphs() OWNER TO postgres; 
     723 
     724-- 
    708725-- Name: trig_update_tsvector_saved_graphs(); Type: FUNCTION; Schema: prism; Owner: reconnoiter 
    709726-- 
     
    713730DECLARE 
    714731 BEGIN 
    715  IF TG_OP != 'INSERT' THEN 
    716732   IF (NEW.graph_tags <> OLD.graph_tags OR NEW.title <> OLD.title) THEN 
    717733           UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid) where graphid=NEW.graphid; 
    718734   END IF;     
    719  ELSE  
    720     UPDATE prism.saved_graphs SET ts_search_all=prism.saved_graphs_tsvector(NEW.graphid) where graphid=(NEW.graphid); 
    721  END IF;   
    722735   RETURN NEW; 
    723736END 
     
    24112424 
    24122425-- 
     2426-- Name: trig_before_tsvector_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter 
     2427-- 
     2428 
     2429CREATE TRIGGER trig_before_tsvector_saved_graphs 
     2430    BEFORE INSERT ON saved_graphs 
     2431    FOR EACH ROW 
     2432    EXECUTE PROCEDURE trig_before_tsvector_saved_graphs(); 
     2433 
     2434 
     2435-- 
    24132436-- Name: trig_update_tsvector_saved_graphs; Type: TRIGGER; Schema: prism; Owner: reconnoiter 
    24142437-- 
    24152438 
    24162439CREATE TRIGGER trig_update_tsvector_saved_graphs 
    2417     AFTER INSERT OR UPDATE ON saved_graphs 
     2440    AFTER UPDATE ON saved_graphs 
    24182441    FOR EACH ROW 
    24192442    EXECUTE PROCEDURE trig_update_tsvector_saved_graphs();