diff options
Diffstat (limited to 'www/wiki/maintenance/postgres/archives/patch-ts2pagetitle.sql')
-rw-r--r-- | www/wiki/maintenance/postgres/archives/patch-ts2pagetitle.sql | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/www/wiki/maintenance/postgres/archives/patch-ts2pagetitle.sql b/www/wiki/maintenance/postgres/archives/patch-ts2pagetitle.sql new file mode 100644 index 00000000..a770c912 --- /dev/null +++ b/www/wiki/maintenance/postgres/archives/patch-ts2pagetitle.sql @@ -0,0 +1,13 @@ +CREATE OR REPLACE FUNCTION ts2_page_title() +RETURNS TRIGGER +LANGUAGE plpgsql AS +$mw$ +BEGIN +IF TG_OP = 'INSERT' THEN + NEW.titlevector = to_tsvector(REPLACE(NEW.page_title,'/',' ')); +ELSIF NEW.page_title != OLD.page_title THEN + NEW.titlevector := to_tsvector(REPLACE(NEW.page_title,'/',' ')); +END IF; +RETURN NEW; +END; +$mw$; |