pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oleg Bartunov <oleg@sai.msu.su>
To: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: tsearch2 problem rank_cd() (possibly) crashing postgres
Date: Fri, 8 Dec 2006 14:54:54 +0300 (MSK)
Message-ID: <Pine.LNX.4.64.0612081453080.16338@sn.sai.msu.ru> (raw)
In-Reply-To: <a97c77030612080350n75934e53n675ecc25773591e8@mail.gmail.com>
References: <a97c77030612080255h131f708brb68495740219229a@mail.gmail.com>
	<Pine.LNX.4.64.0612081442320.16338@sn.sai.msu.ru>
	<a97c77030612080350n75934e53n675ecc25773591e8@mail.gmail.com>

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

> On 12/8/06, Oleg Bartunov <oleg@sai.msu.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@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83



view thread (15+ messages)  latest in thread

Message-ID: <Pine.LNX.4.64.0612081453080.16338@sn.sai.msu.ru>
Permalink:  ../Pine.LNX.4.64.0612081453080.16338@sn.sai.msu.ru/
Also on:    postgresql.org/message-id/Pine.LNX.4.64.0612081453080.16338@sn.sai.msu.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: oleg@sai.msu.su, mallah.rajesh@gmail.com
  Subject: Re: tsearch2 problem rank_cd() (possibly) crashing postgres
  In-Reply-To: <Pine.LNX.4.64.0612081453080.16338@sn.sai.msu.ru>
  References: <a97c77030612080255h131f708brb68495740219229a@mail.gmail.com> <Pine.LNX.4.64.0612081442320.16338@sn.sai.msu.ru> <a97c77030612080350n75934e53n675ecc25773591e8@mail.gmail.com> <Pine.LNX.4.64.0612081453080.16338@sn.sai.msu.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox