From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
---|---|
To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Cc: | jordanthelewis(at)gmail(dot)com |
Subject: | BUG #17562: Strange behavior of to_tsquery() with a - character |
Date: | 2022-07-29 22:18:54 |
Message-ID: | 17562-7c786bed7effbace@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 17562
Logged by: Jordan Lewis
Email address: jordanthelewis(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2022-07-30 02:38:57 | Re: RFC 9266: Channel Bindings for TLS 1.3 support |
Previous Message | Jacob Champion | 2022-07-29 17:28:19 | Re: RFC 9266: Channel Bindings for TLS 1.3 support |