tsvector/tsearch equality and/or portability issue issue ?

From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: tsvector/tsearch equality and/or portability issue issue ?
Date: 2006-08-24 16:34:58
Message-ID: 44EDD532.5040104@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-08-24 16:38:32 Re: Costs estimates for (inline SQL) functions ...
Previous Message Jaime Casanova 2006-08-24 16:02:43 Re: Updatable views