Search Postgresql Archives

tsearch2: more than one index per table?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);

 

 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux