Re: tsvector/tsearch equality and/or portability issue - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: tsvector/tsearch equality and/or portability issue
Date
Msg-id 44F44844.6040801@sigaev.ru
Whole thread Raw
In response to Re: tsvector/tsearch equality and/or portability issue  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>> comparing the same vectors, but stripped. Oddly, the unstripped comparisons all
>> pass, which is not consistant with what I am seeing in my database. However,
>> I'm yet unable to reproduce those problems.

Fixed: strncmp was called with wrong length parameter.

> 
> It looks to me like tsvector comparison may be too strong.  The strip()
> function evidently thinks that it's OK to rearrange the string chunks
> into the same order as the WordEntry items, which suggests to me that
> the "pos" fields are not really semantically significant.  But 
> silly_cmp_tsvector() considers that a difference in pos values is
> important.  I don't understand the data structure well enough to know
> which one to believe, but something's not consistent here.

You are right: Pos really means position of lexeme itself in a tail of tsvector 
structure. So, it's removed from comparison.

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] Another VPATH patch for ecpg
Next
From: Chahine Hamila
Date:
Subject: Re: integration of pgcluster into postgresql