tsearch2: more than one index per table? - Mailing list pgsql-general

From Rick Schumeyer
Subject tsearch2: more than one index per table?
Date
Msg-id 017601c5efe8$afeb4610$0300a8c0@dell8200
Whole thread Raw
Responses Re: tsearch2: more than one index per table?
Re: tsearch2: more than one index per table?
List pgsql-general

Is there something in tsearch2 that prevents more than one index per table?

I would like an index on field A, and a separate index on field B.

The index builds fine for A, but gives an error for B.  The error text is

 

ERROR:  could not find tsearch config by locale

 

The code below is taken almost verbatim from the tsearch2 documentation.

 

Any help is appreciated!

 

================================================================

 

\i /home/rick/ftp/postgresql-8.1.0/contrib/tsearch2/tsearch2.sql

 

CREATE TABLE t (a varchar(20), b varchar(20));

INSERT INTO t (a,b) VALUES ('hello world','quick brown fox');

 

--

-- A

--

 

ALTER TABLE t ADD COLUMN idxA tsvector;

UPDATE t SET idxA=to_tsvector('default', a);

VACUUM FULL ANALYZE;

CREATE INDEX idxA_idx ON t USING gist(idxA);

VACUUM FULL ANALYZE;

 

CREATE TRIGGER ts_A_Update BEFORE UPDATE OR INSERT ON t

FOR EACH ROW EXECUTE PROCEDURE tsearch2(idxA, a);

 

--

-- B

--

 

ALTER TABLE t ADD COLUMN idxB tsvector;

 

--

-- The next line gives: ERROR:  could not find tsearch config by locale

--

UPDATE t SET idxB=to_tsvector('default', b);

 

VACUUM FULL ANALYZE;

CREATE INDEX idxB_idx ON t USING gist(idxB);

VACUUM FULL ANALYZE;

 

CREATE TRIGGER ts_B_Update BEFORE UPDATE OR INSERT ON t

FOR EACH ROW EXECUTE PROCEDURE tsearch2(idxB, b);

 

 

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why pgAdmin III guru suggests VACUUM in 8.1
Next
From: Tom Lane
Date:
Subject: Re: Index Administration: pg_index vs. pg_get_indexdef()