tsvector_update_trigger throws error "column is not of tsvector type" - Mailing list pgsql-general

From Markus Wollny
Subject tsvector_update_trigger throws error "column is not of tsvector type"
Date
Msg-id 28011CD60FB1724DBA4442E38277F62608B9836A@hermes.computec.de
Whole thread Raw
Responses Re: tsvector_update_trigger throws error "column is not of tsvector type"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi!

I am in the process of migrating a PostgreSQL 8.2.4 database to 8.3. So far, everything has worked fine, even
tsearch2-searchingan indexed table. 

There's something severely wrong with the trigger-function I use to keep the tsvector-column updated.

Here's my table definition:

CREATE TABLE public.ct_com_board_message
(
board_id integer DEFAULT 0,
thread_id integer DEFAULT 0,
father_id integer DEFAULT 0,
message_id integer NOT NULL DEFAULT 0,
user_id integer DEFAULT 0,
title text,
signature text,
follow_up text,
count_reply integer DEFAULT 0,
last_reply timestamptz,
created timestamptz DEFAULT now(),
article_id integer DEFAULT 0,
logged_ip text,
state_id smallint DEFAULT 0,
text text,
deleted_date timestamptz,
deleted_login text,
poll_id integer DEFAULT 0,
last_updated timestamptz DEFAULT now(),
idxfti tsvector,
CONSTRAINT "pk_ct_com_board_message" PRIMARY KEY (message_id)
);

And there's this trigger definition:

CREATE TRIGGER "tsvectorupdate"
BEFORE
INSERT OR UPDATE
ON "public"."ct_com_board_message"
FOR EACH ROW
EXECUTE PROCEDURE pg_catalog.tsvector_update_trigger(idxfti,pg_catalog.german,title,text,user_login);

Now when I do anything that fires the trigger like

UPDATE ct_com_board_message set count_reply = 1 where message_id = 12345;

I get an error

ERROR:  column "idxfti" is not of tsvector type

I didn't touch the tsvector_update_trigger-function at all, it still reads

CREATE or REPLACE FUNCTION "pg_catalog"."tsvector_update_trigger"()
RETURNS "pg_catalog"."trigger" AS
$BODY$
tsvector_update_trigger_byid
$BODY$
LANGUAGE 'internal' VOLATILE;

So what's happening here?

Kind regards

   Markus


Computec Media AG
Sitz der Gesellschaft und Registergericht: Fürth (HRB 8818)
Vorstandsmitglieder: Johannes S. Gözalan (Vorsitzender) und Rainer Rosenbusch
Vorsitzender des Aufsichtsrates: Jürg Marquard
Umsatzsteuer-Identifikationsnummer: DE 812 575 276



pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Cannot use a standalone backend to VACUUM in "postgres""
Next
From: Tom Lane
Date:
Subject: Re: select distinct and index usage