Skip site navigation (1) Skip section navigation (2)

Re: tsvector/tsearch equality and/or portability issue

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Phil Frost <indigo(at)bitglue(dot)com>, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: tsvector/tsearch equality and/or portability issue
Date: 2006-08-29 13:59:32
Message-ID: 44F44844.6040801@sigaev.ru (view raw or flat)
Thread:
Lists: 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(at)sigaev(dot)ru
                                                    WWW: http://www.sigaev.ru/

In response to

pgsql-hackers by date

Next:From: Chahine HamilaDate: 2006-08-29 14:19:09
Subject: Re: integration of pgcluster into postgresql
Previous:From: Tom LaneDate: 2006-08-29 13:56:58
Subject: Re: [PATCHES] Another VPATH patch for ecpg

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group