Re: [GENERAL] Update tsvector trigger

2008-08-06 Thread Richard Huxton
x asasaxax wrote: Hi, i´m trying to do a trigger that its called when update or insert, that update the tsvectors, for text-search. Here´s my code: CREATE OR REPLACE FUNCTION atualiza_vectors() RETURNS trigger AS $$ BEGIN IF NEW.texto<>NULL THEN UPDATE x SET vectors =

[GENERAL] Update tsvector trigger

2008-08-05 Thread x asasaxax
Hi, i´m trying to do a trigger that its called when update or insert, that update the tsvectors, for text-search. Here´s my code: create table x( cod serial, texto text, vectors tsvector, constraint pk primary key(cod) ); CREATE OR REPLACE FUNCTION atualiza_vectors() RETURNS trigger AS $$