> You could write a one trigger for the table to handle both.
>

Something like this :


-----

CREATE OR REPLACE FUNCTION multi_tsearch2() RETURNS TRIGGER AS '
DECLARE
BEGIN
    NEW.fti_title = to_tsvector(''default'', NEW.title);
    NEW.fti_author_list = to_tsvector(''simple'', NEW.author_list);
    RETURN NEW;
END;
' LANGUAGE 'PLPGSQL';

CREATE TRIGGER tsvectorupdate_all
  BEFORE INSERT OR UPDATE ON publications
  FOR EACH ROW
  EXECUTE PROCEDURE multi_tsearch2();

----


You can modify the function to be slightly more configurable with parameters 
taking the column names, and config names and make it a little more reusable.  
You can accomplish what you want though.



Andy

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to