After upgrading from Postgres 8.1 to 8.2 (via pg_dumpall) I had problems
with mediawiki (v1.9.2) that utilized tsearch2. I thought I had fixed
the problem by removing tsearch2 in my v8.1 databases, pg_dumpall-ing
and reloading to v8.2, and re-installing tsearch2 from scratch.
When updating a page in mediawiki, I get an error. This is what I am
seeing in my pg_log:
STATEMENT: SELECT nextval('rev_rev_id_val')
ERROR: record "new" has no field "textvector"
CONTEXT: PL/pgSQL function "ts2_page_text" line 3 at assignment
STATEMENT: INSERT /* Revision::insertOn */ INTO pagecontent
(old_id,old_text,old_flags) VALUES ('2128','{| class="wikitable [snip]
The table "pagecontent" has a trigger:
wikidb=> \d pagecontent
Table "mediawiki.pagecontent"
Column | Type | Modifiers
-----------+---------+-------------------------------------------------------
old_id | integer | not null default
nextval('text_old_id_val'::regclass)
old_text | text |
old_flags | text |
Indexes:
"pagecontent_pkey" PRIMARY KEY, btree (old_id)
Triggers:
ts2_page_text BEFORE INSERT OR UPDATE ON pagecontent FOR EACH ROW
EXECUTE PROCEDURE ts2_page_text()
with this code:
BEGIN
IF TG_OP = 'INSERT' THEN
NEW.textvector = to_tsvector('default',NEW.old_text);
ELSIF NEW.old_text != OLD.old_text THEN
NEW.textvector := to_tsvector('default',NEW.old_text);
END IF;
RETURN NEW;
END;
This looks like a problem with tsearch2 to me... can anyone give me a
pointer on where to go from here to debug this? Thanks!
-Jon
--
-**-*-*---*-*---*-*---*-----*-*-----*---*-*---*-----*-----*-*-----*---
Jon Lapham <lapham@xxxxxxxxx> Rio de Janeiro, Brasil
Personal: http://www.jandr.org/
***-*--*----*-------*------------*--------------------*---------------
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend