POSTGRES Compare a json arrays against another array I have a postgres jsonb column called items having  

 [{"id":"","name":""},{"id":"","name":""}] 


I need to compare this whole column with the data

 [{"id":"","name":""},{"id":"","name":""}]
If you mean an exact string match then you can do:

SELECT * FROM table where items::text = '[{"id":"","name":""},{"id":"","name":""}]'

Note that JSONB does not necessarily keep the order in the objects the same so it might not work all the time because the order of items might change on the output.

You can lookup the Postgres docs for more advanced JSON operations where you can actually look inside the values.