From: Alexander B. <burbello3000@yahoo.com.br>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Trigger using Tsearch
Date: Tue, 20 Mar 2007 15:47:25 -0300
Message-ID: <46002C3D.5020602@yahoo.com.br> (raw)
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: burbello3000@yahoo.com.br
Subject: Re: Trigger using Tsearch
In-Reply-To: <46002C3D.5020602@yahoo.com.br>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox