RE: SQL issue after migrating from version 13 to 15
От | Campbell, Lance |
---|---|
Тема | RE: SQL issue after migrating from version 13 to 15 |
Дата | |
Msg-id | SJ0PR11MB5629FF3A0251014B14EBEB79DED8A@SJ0PR11MB5629.namprd11.prod.outlook.com обсуждение исходный текст |
Ответ на | Re: SQL issue after migrating from version 13 to 15 (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-sql |
Thanks so much for the assistance. That resolved my issue. I hope you have a great week. Lance -----Original Message----- From: Tom Lane <tgl@sss.pgh.pa.us> Sent: Monday, October 23, 2023 10:31 AM To: Campbell, Lance <lance@illinois.edu> Cc: pgsql-sql@lists.postgresql.org Subject: Re: SQL issue after migrating from version 13 to 15 "Campbell, Lance" <lance@illinois.edu> 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 13to 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 punctuationwill behave the same. Or you could switch to plainto_tsquery(), which disregards the punctuation altogether. regards, tom lane
В списке pgsql-sql по дате отправления: