From: | "Jon Asher" <jon(at)vagabond-software(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org>, <sfpug(at)postgresql(dot)org> |
Subject: | Basic problem installing TSearch2 (full text search) |
Date: | 2004-12-23 06:34:24 |
Message-ID: | 20041223063427.8A2F23ABF78@svr1.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general sfpug |
Hi all,
I've installed TSearch2 with some success- my table now contains a tsvector
field that's indexed and I can run full text queries.
However, the trigger that I created to update the full text index when a row
is modified appears to cause a problem. It's returning the error when I run
an Update statement:
could not find tsearch config by locale
The general intro doc to TSearch2 covers this error and explains how to fix
it.
(http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intr
o.html) I thought that I changed the config properly but obviously I'm
missing something. The steps I followed and the values in the system tables
I updated are listed below. I'd appreciate any input!
/* add indexed text field and trigger */
UPDATE log SET fti_notes = to_tsvector('default', notes);
CREATE INDEX log_fti_notes_index ON log USING gist(fti_notes);
vacuum analyze log;
CREATE TRIGGER trg_log_update_tsvector BEFORE UPDATE OR INSERT ON log
FOR EACH ROW EXECUTE PROCEDURE tsearch2(fti_notes, notes);
/* update configuration file */
SHOW server_encoding;
/* above command displays: SQL_ASCII */
update pg_ts_cfg set locale = 'SQL_ASCII' where ts_name = 'default'
SELECT * from pg_ts_cfg
/* above Select returns the following */
ts_name prs_name locale
default default SQL_ASCII
/* now test tsearch. Select statements work! however, update statement with
associated trigger fails /*
update log set notes = 'Evergreen in San Jose is a nice place.' where log_id
= 529
/* returns error message: could not find tsearch config by locale */
From | Date | Subject | |
---|---|---|---|
Next Message | Együd Csaba | 2004-12-23 07:00:45 | Very slow stored proc |
Previous Message | Tom Lane | 2004-12-23 03:42:15 | Re: converting unique index into primary key |
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2004-12-24 21:24:59 | Re: [sfpug] Basic problem installing TSearch2 (full text |
Previous Message | Sean Chittenden | 2004-12-18 00:37:58 | pgmemcache 1.0 rc1... |