From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: jordanthelewis@gmail.com
Subject: BUG #17562: Strange behavior of to_tsquery() with a - character
Date: Fri, 29 Jul 2022 22:18:54 +0000
Message-ID: <17562-7c786bed7effbace@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17562
Logged by: Jordan Lewis
Email address: jordanthelewis@gmail.com
PostgreSQL version: 14.3
Operating system: Linux
Description:
When using the to_tsquery function, including a - character in the input
produces a strange behavior: it returns a query that expects the entire
input next to the string to the left of the - character next to the string
to the right of the dash character.
Observe the following example:
jordan=> select to_tsquery('foo-bar');
to_tsquery
-------------------------------
'foo-bar' <-> 'foo' <-> 'bar'
(1 row)
I would expect that the correct behavior would be to either treat foo-bar as
a single search term, or to treat foo and bar as separate search terms
(which would cause this to fail because of the lack of operator separating
the terms).
In Postgres 13, the result is to separate the 3 terms by & instead of <->,
which still doesn't seem right to me.
Thoughts?
Thank you,
Jordan Lewis
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 #17562: Strange behavior of to_tsquery() with a - character
In-Reply-To: <17562-7c786bed7effbace@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