public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Campbell, Lance <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: SQL issue after migrating from version 13 to 15
Date: Mon, 23 Oct 2023 11:31:17 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <SJ0PR11MB562987A3390C885A8916E95ADED8A@SJ0PR11MB5629.namprd11.prod.outlook.com>
References: <SJ0PR11MB562987A3390C885A8916E95ADED8A@SJ0PR11MB5629.namprd11.prod.outlook.com>

"Campbell, Lance" <[email protected]> writes:
> The below segment of the where clause works fine if the value passed is a single value like "real":

> AND to_tsvector('simple', CAST (table_column as text)) @@ to_tsquery('simple', 'real')

> However, this no longer works when there are two values "real,impact". The only change was migrating from PostgreSQL 13 to 15:

> AND to_tsvector('simple', CAST (table_column as text)) @@ to_tsquery('simple', 'real,impact')

You really should define what you mean by "works" in a question
like this.

However, I think what you are unhappy about is that the interpretation
of that to_tsquery input has changed.  In v13:

regression=# select to_tsquery('simple', 'real,impact');
    to_tsquery     
-------------------
 'real' & 'impact'
(1 row)

In v14 and later:

regression=# select to_tsquery('simple', 'real,impact');
     to_tsquery      
---------------------
 'real' <-> 'impact'
(1 row)

The v14 release notes mention that there were incompatible changes in
this area, although they don't cite this specific case.  But anyway,
if the behavior you want is & then I'd suggest writing &, rather than
assuming that some other punctuation will behave the same.  Or you
could switch to plainto_tsquery(), which disregards the punctuation
altogether.

			regards, tom lane





view thread (3+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: SQL issue after migrating from version 13 to 15
  In-Reply-To: <[email protected]>

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

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