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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql(at)tomd(dot)cc
Cc: pgsql-bugs(at)postgresql(dot)org, Oleg Bartunov <obartunov(at)gmail(dot)com>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: BUG #14515: tsquery with only a negative term doesn't match empty tsvector
Date: 2017-01-26 03:32:28
Message-ID: 30721.1485401548@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql(at)tomd(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message andrew 2017-01-26 05:02:59 BUG #14516: misleading error from libpq on out-of-memory
Previous Message pgsql 2017-01-26 02:55:24 BUG #14515: tsquery with only a negative term doesn't match empty tsvector