I have column arr
which is of type array
.
I need to get rows, where arr
column contains value s
This query:
SELECT * FROM table WHERE arr @> ARRAY['s']
gives the error:
ERROR: operator does not exist: character varying[] @> text[]
Why does it not work?
p.s. I know about any()
operator, but why doesn't @>
work?
Try
Note that this may also work:
Compare two arrays for containment.