Answer the question
In order to leave comments, you need to log in
How to properly implement array iteration (jsonb) in Postgresql?
Good day.
Faced such a problem.
This code works (it doesn't find anything because params->'sex' is a number):
SELECT * FROM goods WHERE jsonb_exists_any(params->'sex', array['1', '2', '3', '4'])
SELECT * FROM goods WHERE jsonb_exists_any(params->'sex', array[1, 2, 3, 4])
ERROR: function jsonb_exists_any(jsonb, integer[]) does not exist
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question