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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to