Re: tsearch2 upgrade problem and mediawiki

From: Richard Huxton <dev(at)archonet(dot)com>
To: lapham(at)jandr(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2 upgrade problem and mediawiki
Date: 2007-08-02 19:17:01
Message-ID: 46B22DAD.2050107@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jon Lapham wrote:
> 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"

> 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!

Well, that's a trigger that's updating a column called "textvector" of
type tsvector (a tsearch2 type). It's not a tsearch2 trigger function
though, so presumably it comes with mediawiki.

Try just adding the column, I'm guessing it was dropped while you were
taking out the old tsearch2 installation.
ALTER TABLE pagecontent ADD COLUMN textvector tsvector;

Incidentally, I tend to install tsearch2 in its own schema now, makes it
simpler to check what's installed. It does mean you need to do alter
your search_path though.

Oh, and 8.3 will have tsearch as a built-in.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guy Fraser 2007-08-02 19:31:18 Re: array_to_set functions
Previous Message Tom Lane 2007-08-02 19:14:31 Re: want to drop corrupt db