pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: jordanthelewis@gmail.com
Subject: BUG #17542: tsquery returns incorrect results with nested, conjuncted followed-by operators
Date: Sat, 09 Jul 2022 01:35:42 +0000
Message-ID: <17542-69860f66186a43e4@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17542
Logged by:          Jordan Lewis
Email address:      jordanthelewis@gmail.com
PostgreSQL version: 14.3
Operating system:   Linux
Description:        

Consider the following query:

jordan=> select '((a <2> c) & (b <-> c)) <-> d'::tsquery @@ 'a:1 b:2 c:3
d:4';
 ?column?
----------
 f
(1 row)

I think this should return "true", because both of the expressions on the
left-hand-side of the outer <-> operator of the tsquery do in fact precede
the "d" term in the tsvector.

Here is output that shows this:

jordan=> select '((a <2> c)) <-> d'::tsquery @@ 'a:1 b:2 c:3 d:4';
 ?column?
----------
 t
(1 row)

jordan=> select '((b <-> c)) <-> d'::tsquery @@ 'a:1 b:2 c:3 d:4';
 ?column?
----------
 t
(1 row)

I think things go wrong in the query executor because the two LHS clauses
have different widths.

Do you agree that this is incorrect output?



view thread (3+ messages)  latest in thread

Message-ID: <17542-69860f66186a43e4@postgresql.org>
Permalink:  ../17542-69860f66186a43e4@postgresql.org/
Also on:    postgresql.org/message-id/17542-69860f66186a43e4@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, jordanthelewis@gmail.com
  Subject: Re: BUG #17542: tsquery returns incorrect results with nested, conjuncted followed-by operators
  In-Reply-To: <17542-69860f66186a43e4@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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