Re: How to submit Tsearch V2 ? - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: How to submit Tsearch V2 ?
Date
Msg-id 3F055F51.4020205@sigaev.ru
Whole thread Raw
In response to Re: How to submit Tsearch V2 ?  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: How to submit Tsearch V2 ?
Re: How to submit Tsearch V2 ?
List pgsql-hackers
I think with upgrade X.Y to X.Y+1 version of pgsql you need dump/restore all 
databases, isn't it?

So, for upgrading tsearch to V2 you need to do following:
1 rename columns or typecast for type txtidx to tsvector,  query_txt to tsquery
2 rename function txt2txtidx to to_tsvector, ( may be to strip(to_tsvector()),  now tsvector has information for
ranking), trigger 'tsearch' isn't changed
 
3 operator class (in create index command) gist_txtidx_ops to gist_tsvector_ops
4 In queries: operator ## to @@ to_tsquery() and remove mquery_txt typecast
5 If your locale of pgsql differ from 'C', execute before first query  select set_curcfg('default');

That's all. So upgrade from v1 to v2 isn't difficult.



Christopher Kings-Lynne wrote:
>>>>>Out of interest - is it completely backwards compatible?
>>>>
>>>>unfortunately, no
>>>
>>>Then surely fully replacing tsearch will cause badness?
>>
>>I see, so are you suggesting separate dir for tsearch v2 ?
> 
> 
> Well, we use tserach 1 extensively.  I want to be able to upgrade to 7.4 and
> have nothing break!
> 
> If things will break, then you need to have a tsearch2 dir instead.
> 
> Chris
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
Teodor Sigaev                                  E-mail: teodor@sigaev.ru



pgsql-hackers by date:

Previous
From: Jean-Michel POURE
Date:
Subject: Re: [pgadmin-hackers] [GENERAL] pgAdmin III - Call for Translators
Next
From: Oleg Bartunov
Date:
Subject: Re: How to submit Tsearch V2 ?