Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1quwtp-002GcR-0w for pgsql-sql@arkaria.postgresql.org; Mon, 23 Oct 2023 15:31:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1quwtm-00B1I5-UD for pgsql-sql@arkaria.postgresql.org; Mon, 23 Oct 2023 15:31:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1quwtm-00B1Gm-KD for pgsql-sql@lists.postgresql.org; Mon, 23 Oct 2023 15:31:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1quwtk-001vPm-Id for pgsql-sql@lists.postgresql.org; Mon, 23 Oct 2023 15:31:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 39NFVHVV381372; Mon, 23 Oct 2023 11:31:17 -0400 From: Tom Lane To: "Campbell, Lance" cc: "pgsql-sql@lists.postgresql.org" Subject: Re: SQL issue after migrating from version 13 to 15 In-reply-to: References: Comments: In-reply-to "Campbell, Lance" message dated "Mon, 23 Oct 2023 15:19:35 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <381370.1698075077.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 23 Oct 2023 11:31:17 -0400 Message-ID: <381371.1698075077@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Campbell, Lance" 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('si= mple', 'real') > However, this no longer works when there are two values "real,impact". T= he only change was migrating from PostgreSQL 13 to 15: > AND to_tsvector('simple', CAST (table_column as text)) @@ to_tsquery('si= mple', '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=3D# select to_tsquery('simple', 'real,impact'); to_tsquery = ------------------- 'real' & 'impact' (1 row) In v14 and later: regression=3D# 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