upgrading tsearch2: how to call function in trigger - Mailing list pgsql-general

From robert
Subject upgrading tsearch2: how to call function in trigger
Date
Msg-id 4EDF1C77.6070202@redcor.ch
Whole thread Raw
List 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 by date:

Previous
From:
Date:
Subject: Re: [pgadmin-support] Help for Migration
Next
From: Craig Ringer
Date:
Subject: Re: [pgadmin-support] Help for Migration