Re: tsearch2 problem rank_cd() (possibly) crashing postgres

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Rajesh Kumar Mallah <mallah(dot)rajesh(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: tsearch2 problem rank_cd() (possibly) crashing postgres
Date: 2006-12-08 11:54:54
Message-ID: Pine.LNX.4.64.0612081453080.16338@sn.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 8 Dec 2006, Rajesh Kumar Mallah wrote:

> On 12/8/06, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> wrote:
>> You need to read documentation ! rank_cd accepts the same args as rank()
>> function.
>
> Dear Oleg,
>
> Could you please elaborate a bit more if time permits.
> our application is old and it was working fine in 8.1.5. do i need to
> change the sql
> to use a different function ?

from reference manual:

CREATE FUNCTION rank_cd(
[ weights float4[], ] vector TSVECTOR, query TSQUERY, [ normalization int4 ]
) RETURNS float4

postgres=# SELECT name, rank_cd(name_vec,to_tsquery('hello') ) as rank from test where name_vec @@ to_tsquery('hello') ;
name | rank
-------------+------
hello world | 0.1
(1 row)

or

postgres=# SELECT name, rank_cd('{1,1,1,1}',name_vec,to_tsquery('hello') ) as rank from test where name_vec @@ to_tsquery('hello') ;
name | rank
-------------+------
hello world | 1
(1 row)

>
>>
>> Oleg
>> On Fri, 8 Dec 2006, Rajesh Kumar Mallah wrote:
>>
>

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message ankit.mehrotra 2006-12-08 12:03:16 Re: problem in logging into database
Previous Message Rajesh Kumar Mallah 2006-12-08 11:50:37 Re: tsearch2 problem rank_cd() (possibly) crashing postgres