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

From Stefan Kaltenbrunner
Subject tsvector/tsearch equality and/or portability issue issue ?
Date
Msg-id 44EDD532.5040104@kaltenbrunner.cc
Whole thread Raw
Responses Re: tsvector/tsearch equality and/or portability issue issue ?  ("Andrew J. Kopciuch" <akopciuch@bddf.ca>)
Re: tsvector/tsearch equality and/or portability issue  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
We just had a complaint on IRC that:

devel=# select 'blah foo bar'::tsvector = 'blah foo bar'::tsvector;?column?
----------f
(1 row)

and that searches for certain values would not return all matches under
some circumstances.

a little bit of testing shows the following:

postgres=# create table foo (bla tsvector);
CREATE TABLE
postgres=# insert into foo values ('bla bla');
INSERT 0 1
postgres=# insert into foo values ('bla bla');
INSERT 0 1
postgres=# select bla from foo group by bla; bla
-------'bla'
(1 row)

postgres=# create index foo_idx on foo(bla);
CREATE INDEX
postgres=# set enable_seqscan to off;
SET
postgres=# select bla from foo group by bla; bla
-------'bla''bla'
(2 rows)

postgres=# set enable_seqscan to on;
SET
postgres=# select bla from foo group by bla; bla
-------'bla'
(1 row)

ouch :-(

I can reproduce that at least on OpenBSD/i386 and Debian Etch/x86_64.

It is also noteworthy that the existing regression tests for tsearch2 do
not seem to do any equality testing ...


Stefan


pgsql-hackers by date:

Previous
From: "Jaime Casanova"
Date:
Subject: Re: [PATCHES] Updatable views
Next
From: Bruce Momjian
Date:
Subject: Re: Costs estimates for (inline SQL) functions ...