Re: BUG #18218: NOT LIKE ANY returns same result as LIKE ANY when array items are wrapped into E''
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #18218: NOT LIKE ANY returns same result as LIKE ANY when array items are wrapped into E'' |
| Дата | |
| Msg-id | 461815.1701349582@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | BUG #18218: NOT LIKE ANY returns same result as LIKE ANY when array items are wrapped into E'' (PG Bug reporting form <noreply@postgresql.org>) |
| Ответы |
Re: BUG #18218: NOT LIKE ANY returns same result as LIKE ANY when array items are wrapped into E''
|
| Список | pgsql-bugs |
PG Bug reporting form <noreply@postgresql.org> writes:
> select 'TextToMatch' like any (array[E'Te\%tch', E'nomatch']); -- true,
> correct
> select 'TextToMatch' NOT like any (array[E'Te\%tch', E'nomatch']); -- true
> but must be false because it's a negated version of the expression above
No, it is not. "NOT LIKE" is the operator to apply in this context,
so the second expression returns true if the test string is NOT LIKE
either of the array elements. You could write
NOT ('TextToMatch' like any (array[E'Te\%tch', E'nomatch']))
to get the behavior you are after. Or write NOT LIKE ALL,
as Orlov suggests.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера