JSONB arrays - Mailing list pgsql-general

From Victor Noagbodji
Subject JSONB arrays
Date
Msg-id 246BDA5E-A436-4985-91E1-D20C14C3DF00@amplify-nation.com
Whole thread Raw
Responses RE: JSONB arrays
List pgsql-general
Hey people,

I ended up with the following to check (or similar to return) the intersection of two list of values on a JSONB object:

array_length(
array(
select jsonb_array_elements_text(col1)
intersect
select jsonb_array_elements_text(col2)
), 1) > 0

Is there a better way?

Thanks

pgsql-general by date:

Previous
From: "joby.john@nccgroup.trust"
Date:
Subject: Re: Database name with semicolon
Next
From: Anto Aravinth
Date:
Subject: Index Gin Creation is taking long time..