Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id BB5309FA19B for ; Fri, 8 Dec 2006 07:55:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 52555-08 for ; Fri, 8 Dec 2006 07:54:45 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sn.sai.msu.ru (sn.sai.msu.ru [195.208.220.215]) by postgresql.org (Postfix) with ESMTP id 718379F93A4 for ; Fri, 8 Dec 2006 07:55:00 -0400 (AST) Received: from sn.sai.msu.ru (localhost [127.0.0.1]) by sn.sai.msu.ru (8.12.8/8.12.8) with ESMTP id kB8Bss6k020796; Fri, 8 Dec 2006 14:54:54 +0300 Received: from localhost (megera@localhost) by sn.sai.msu.ru (8.12.8/8.12.8/Submit) with ESMTP id kB8BssF5020793; Fri, 8 Dec 2006 14:54:54 +0300 X-Authentication-Warning: sn.sai.msu.ru: megera owned process doing -bs Date: Fri, 8 Dec 2006 14:54:54 +0300 (MSK) From: Oleg Bartunov X-X-Sender: megera@sn.sai.msu.ru To: Rajesh Kumar Mallah cc: pgsql-admin@postgresql.org Subject: Re: tsearch2 problem rank_cd() (possibly) crashing postgres In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/68 X-Sequence-Number: 23860 On Fri, 8 Dec 2006, Rajesh Kumar Mallah wrote: > On 12/8/06, Oleg Bartunov 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