summaryrefslogtreecommitdiff
path: root/maintenance/postgres/archives/patch-ts2pagetitle.sql
blob: 4ac985e3758da403ac7ffccf7f35d2737ac89161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
CREATE OR REPLACE FUNCTION ts2_page_title()
RETURNS TRIGGER
LANGUAGE plpgsql AS
$mw$
BEGIN
IF TG_OP = 'INSERT' THEN
  NEW.titlevector = to_tsvector('default',REPLACE(NEW.page_title,'/',' '));
ELSIF NEW.page_title != OLD.page_title THEN
  NEW.titlevector := to_tsvector('default',REPLACE(NEW.page_title,'/',' '));
END IF;
RETURN NEW;
END;
$mw$;