pg_migrator and an 8.3-compatible tsvector data type

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: pg_migrator and an 8.3-compatible tsvector data type
Date: 2009-05-26 01:45:59
Message-ID: 200905260145.n4Q1jx727301@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I found out at PGCon that the internal format of tsvector changed
slightly from 8.3 to 8.4. Teodor gave me a conversion function and I
have adjusted pg_migrator to install a v8_3_tsvector data type to be
used during the load so the old user tables use that data type. You can
see the code here at the bottom of this file:

http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pg-migrator/pg_migrator/src/pg_migrator.c?rev=1.36&content-type=text/x-cvsweb-markup

I am not done yet because eventually v8_3_tsvector will be moved into a
separate schema and the tsvector data type restored.

The problem I have is that while I have created v8_3_tsvector (with
casts), I have not created index routines for it, so I get this error
when restoring a database that uses a GIN index on tsvector:

Restoring database schema
psql:/u/postgres/pg_migrator_dump_db.sql:7006: ERROR: data type
tsvector has no default operator class for access method "gin"
HINT: You must specify an operator class for the index or define a
default operator class for the data type.

So, how do I create a compatible set of hooks for v8_3_tsvector?
Because tsvector is a native data type I can't figure out how to set up
a similar type. Also, will the indexes be OK if they are created from
types that don't have the 8.3 format? What about new indexes created
after the migration is done?

Ideally the cast would just be called during index activity and the 8.4
tsvector index routines used. I am told by Teodor that GiST indexes
would be fine with the 8.3 data format, and we are forcing the
reindexing of GIN indexes anyway in 8.4.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-05-26 02:06:43 Re: Synchronous replication: Admin command for replication_timeout_action
Previous Message Robert Haas 2009-05-26 01:12:59 Re: generic options for explain