One of the table in postgreSQL has a column of datatype text[]
TableA:
id uuid
tableb_ids text[]
TableB:
id uuid
name text
Now I need to write a query like:
select * from tableB where id in (select tableb_ids from tableA where id ="xxxx-xxxx-xxxx-xxxx")
I cannot change the schema/table definitions. i.e) I cannot keep many entries for every entry of tableB in tableA. TableA is a complex table.
SELECT b.* FROM tableb b JOIN tablea a ON b.id = ANY(a.tableb_ids)ERROR: operator does not exist: uuid = text[]when I try that wayb.id::TEXT = ANY(a.tableb_ids)