Skip site navigation (1) Skip section navigation (2)

Basic problem installing TSearch2 (full text search)

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 (view raw or flat)
Thread:
Lists: pgsql-generalsfpug
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 */

Responses

sfpug by date

Next:From: Josh BerkusDate: 2004-12-24 21:24:59
Subject: Re: [sfpug] Basic problem installing TSearch2 (full text
Previous:From: Sean ChittendenDate: 2004-12-18 00:37:58
Subject: pgmemcache 1.0 rc1...

pgsql-general by date

Next:From: Együd CsabaDate: 2004-12-23 07:00:45
Subject: Very slow stored proc
Previous:From: Tom LaneDate: 2004-12-23 03:42:15
Subject: Re: converting unique index into primary key

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group