pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT
2+ messages / 1 participants
[nested] [flat]

* pgsql: Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT
@ 2020-07-24 19:44  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-07-24 19:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT.

It's fairly silly that ignoring NOT subexpressions is TS_execute's
default behavior.  It's wrong on its face and it encourages errors
of omission.  Moreover, the only two remaining callers that aren't
specifying CALC_NOT are in ts_headline calculations, and it's very
arguable that those are bugs: if you've specified "!foo" in your
query, why would you want to get a headline that includes "foo"?

Hence, rip that out and change the default behavior to be to calculate
NOT accurately.  As a concession to the slim chance that there is still
somebody somewhere who needs the incorrect behavior, provide a new
SKIP_NOT flag to explicitly request that.

Back-patch into v13, mainly because it seems better to change this
at the same time as the previous commit's rejiggering of TS_execute
related APIs.  Any outside callers affected by this change are
probably also affected by that one.

Discussion: https://postgr.es/m/CALT9ZEE-aLotzBg-pOp2GFTesGWVYzXA3=mZKzRDa_OKnLF7Mg@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/70eca6a9a6df679a86f30442194cc6b858b82000

Modified Files
--------------
src/backend/utils/adt/tsginidx.c    | 4 ++--
src/backend/utils/adt/tsgistidx.c   | 4 ++--
src/backend/utils/adt/tsrank.c      | 2 +-
src/backend/utils/adt/tsvector_op.c | 8 ++++----
src/include/tsearch/ts_utils.h      | 8 +++++---
5 files changed, 14 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT
@ 2020-07-24 19:44  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-07-24 19:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT.

It's fairly silly that ignoring NOT subexpressions is TS_execute's
default behavior.  It's wrong on its face and it encourages errors
of omission.  Moreover, the only two remaining callers that aren't
specifying CALC_NOT are in ts_headline calculations, and it's very
arguable that those are bugs: if you've specified "!foo" in your
query, why would you want to get a headline that includes "foo"?

Hence, rip that out and change the default behavior to be to calculate
NOT accurately.  As a concession to the slim chance that there is still
somebody somewhere who needs the incorrect behavior, provide a new
SKIP_NOT flag to explicitly request that.

Back-patch into v13, mainly because it seems better to change this
at the same time as the previous commit's rejiggering of TS_execute
related APIs.  Any outside callers affected by this change are
probably also affected by that one.

Discussion: https://postgr.es/m/CALT9ZEE-aLotzBg-pOp2GFTesGWVYzXA3=mZKzRDa_OKnLF7Mg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/79d6d1a277ee1cdda90f9a66d7970ac3885822de

Modified Files
--------------
src/backend/utils/adt/tsginidx.c    | 4 ++--
src/backend/utils/adt/tsgistidx.c   | 4 ++--
src/backend/utils/adt/tsrank.c      | 2 +-
src/backend/utils/adt/tsvector_op.c | 8 ++++----
src/include/tsearch/ts_utils.h      | 8 +++++---
5 files changed, 14 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-07-24 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 19:44 pgsql: Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT Tom Lane <tgl@sss.pgh.pa.us>
2020-07-24 19:44 pgsql: Replace TS_execute's TS_EXEC_CALC_NOT flag with TS_EXEC_SKIP_NOT Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox