Re: BUG #14515: tsquery with only a negative term doesn't match empty tsvector

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql@tomd.cc
Cc: pgsql-bugs@postgresql.org, Oleg Bartunov <obartunov@gmail.com>, Teodor Sigaev <teodor@sigaev.ru>
Date: 2017-01-26T03:32:28Z
Lists: pgsql-bugs
pgsql@tomd.cc writes:
> Basically while `select 'somethingelse'::tsvector @@ '!foo'::tsquery`
> returns true, `select ''::tsvector @@ '!foo'::tsquery` returns false, which
> was surprising to me.

Not sure about this.  A plausible reading of '!foo' is "there is a lexeme
that is not foo".  But even if that was Oleg & Teodor's intention,
I would not want to swear that the tsquery stuff is totally consistent
about it ...

			regards, tom lane


Commits

  1. Ensure that a tsquery like '!foo' matches empty tsvectors.

  2. Move some things from builtins.h to new header files