upgrading tsearch2: how to call function in trigger

Поиск
Список
Период
Сортировка
От robert
Тема upgrading tsearch2: how to call function in trigger
Дата
Msg-id 4EDF1C77.6070202@redcor.ch
обсуждение исходный текст
Список pgsql-general
Hi there,

I am in the process of porting an application from V8.1 to 9.x
Now I have the following situation:

there is a function tsearch2:
CREATE FUNCTION tsearch2() RETURNS "trigger"
     AS '$libdir/tsearch2', 'tsearch2'
     LANGUAGE c;

a second function:
CREATE FUNCTION dropatsymbols(text) RETURNS text
     AS $_$select replace($1,'-', ' ');select replace($1,':', ' ');$_$
     LANGUAGE sql;

and an update trigger that is fired when a record is inserted:
CREATE TRIGGER dok_tsvectorupdate
     BEFORE INSERT OR UPDATE ON dokument
     FOR EACH ROW
     EXECUTE PROCEDURE tsearch2('idxfti_dok', 'dropatsymbols', 'docnum',
'titel', 'deskriptoren', 'ablage', 'ort');


Now my problem:
In above trigger tsearch2 is called with:
     tsearch2('idxfti_dok', 'dropatsymbols', 'docnum', 'titel', 'deskriptoren',
'ablage', 'ort');
which generates the error:
ERROR:  column "dropatsymbols" does not exist

which is correct as dropatsymbols is a function and not a column.

what should I do to avoid said error?

thanks for your time

robert

В списке pgsql-general по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re: [pgadmin-support] Help for Migration
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: [pgadmin-support] Help for Migration