root/sql/sprocs/prism.trig_update_tsvector_saved_graphs.sql

Revision a27cd9b462a686609eff744d1e6553da5605090b, 482 bytes (checked in by Depesz Lubaczewski <depesz@omniti.com>, 5 years ago)

prism procedures, and simple tool to split pg_dump -n prism -s output into many files

  • Property mode set to 100644
Line 
1 CREATE OR REPLACE FUNCTION prism.trig_update_tsvector_saved_graphs() RETURNS trigger
2     AS $$
3 DECLARE
4 ref_title text;
5  BEGIN
6  IF TG_OP = 'UPDATE' THEN
7               NEW.ts_search_all=prism.saved_graphs_tsvector(NEW.graphid);
8   ELSE
9       ref_title:=coalesce(replace(NEW.title, '.', ' '), ' ');
10      NEW.ts_search_all =to_tsvector(ref_title);
11   END IF; 
12    RETURN NEW;
13 END
14 $$
15     LANGUAGE plpgsql;
16
17
18 ALTER FUNCTION prism.trig_update_tsvector_saved_graphs() OWNER TO reconnoiter;
Note: See TracBrowser for help on using the browser.