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

From Oleg Bartunov
Subject Re: tsearch2: more than one index per table?
Date
Msg-id Pine.GSO.4.63.0511231719520.29329@ra.sai.msu.su
Whole thread Raw
In response to Re: tsearch2: more than one index per table?  ("Rick Schumeyer" <rschumeyer@ieee.org>)
List pgsql-general
On Wed, 23 Nov 2005, Rick Schumeyer wrote:

> I apologize if I'm being dense, but I'm not completely following the
> explanation.  It is true that my pg_ts_cfg.locale is set to en_US.UTF-8.
>
> It was my understanding that specifying "default" as in
>
> UPDATE t SET idxB=to_tsvector('default', b);
>
> should give tsearch enough information.
>
> It is not clear to me why the first time works, but not the second time
> with almost identical statements.
>
> I thought that I only had to follow the procedure in the docs if I want
> to do the following:
>
> UPDATE t SET idxB=to_tsvector(b); -- no 'default'
>
> Perhaps I am wrong about this?

nothing wrong except trigger you defined 'BEFORE UPDATE OR INSERT' fired
and it has no knowledge which configuration to use.
You may put trigger statement after update, but you'll get the same
error when inserting something to table.

Don't resist and configure tsearch2 to match server's locale.
It's most painless way.


>
>> -----Original Message-----
>> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
>> owner@postgresql.org] On Behalf Of Andrew J. Kopciuch
>> Sent: Wednesday, November 23, 2005 12:08 AM
>> To: pgsql-general@postgresql.org
>> Subject: Re: [GENERAL] tsearch2: more than one index per table?
>>
>> On Tuesday 22 November 2005 21:45, Rick Schumeyer wrote:
>>> 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
>>>
>>>
>>
>>
>> This is not a problem with the index creation ... your tsearch2
>> installation
>> is not configured for the locale your server is running.
>>
>> http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-
>> intro.html
>>
>> See the section "TSEARCH2 CONFIGURATION".  It explains, and has examples
>> on
>> how to set this up.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

     Regards,
         Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

pgsql-general by date:

Previous
From: "Rick Schumeyer"
Date:
Subject: Re: tsearch2: more than one index per table?
Next
From: Richard van den Berg
Date:
Subject: Re: pg_ctl start leaves dos window open