Trigger using Tsearch - Mailing list pgsql-admin

From Alexander B.
Subject Trigger using Tsearch
Date
Msg-id 46002C3D.5020602@yahoo.com.br
Whole thread Raw
List pgsql-admin
Hi for all,

I just installed Tsearch and was trying to configure automatic update on
such table using trigger and procedure.
But I get error on inserting data on the table.
Could you help me to find out what I am wronging?

#### Procedure created:
create or replace function fn_atualiza_tsearch_cid_endereco()
  returns trigger as '
BEGIN
  update tb_cep_cidade_endereco
     set cue_idx_endereco = to_tsvector(''default_portuguese'',
coalesce(to_ascii(NEW.cue_logradouro, ''LATIN1''), ''''))
   where cue_cod_endereco = new.cue_cod_endereco
     and cue_cep = new.cue_cep;

  RETURN NEW;
END;
' LANGUAGE plpgsql;

$ created sucessfully;


#### Trigger created:
create trigger trg_atualiza_tsearch_cid_endereco
  after insert or update on tb_cep_cidade_endereco
  for each row execute procedure fn_atualiza_tsearch_cid_endereco();

$ created sucessfully;


### Insert data
INSERT INTO tb_cep_cidade_endereco . . .

and returns:
>[Error] Script lines: 1-3 --------------------------
 Um erro de E/S ocorreu ao enviar para o processo do servidor.

An error I/O occurred sending to the server process




_______________________________________________________
Yahoo! Mail - Sempre a melhor opção para você!
Experimente já e veja as novidades.
http://br.yahoo.com/mailbeta/tudonovo/



pgsql-admin by date:

Previous
From: "Sabin Coanda"
Date:
Subject: recovering using a continuous archive backup doesn't work on Windows
Next
From: "Karthikeyan Sundaram"
Date:
Subject: ERROR: invalid byte sequence for encoding "UTF8": 0x92