I have a column available_sizes in PostgreSQL table with a type array: text[]
select available_sizes from products;
{37,38,39,40}
...
Sometimes I need to check what rows contain certain values, e.g. both 39 and 40, so I tried to do it this way:
select *
from products
where available_sizes && ('{39, 40}');
Returns rows containing either 39 or 40
select *
from products
where available_sizes = ANY ('{41, 42}');
Returns an error: "could not find array type for data type text[]"
How would you solve this please? Sorry, not an expert in SQL/PostgreSQL