I'm trying to insert records but where a match already exists, it should update but i keep getting the error below.
ERROR: ON CONFLICT DO UPDATE not supported with exclusion constraints
Below is my update query
INSERT INTO table_b (b)
SELECT array_remove(ARRAY[(SELECT id FROM table_c c WHERE c.id_a=u.id_a AND c.type_id=1),
(SELECT id FROM table_c c WHERE c.id_a=u.id_b AND c.type_id=2)],NULL)
FROM table_a u
ON CONFLICT ON CONSTRAINT b_constr
DO UPDATE SET b = EXCLUDED.b;
below is also a constraint on table_b
CREATE TABLE table_b
(
id ,
b integer[],
CONSTRAINT b_constr EXCLUDE
USING gist (b WITH &&)
)
How do I get to update the rows where a match already exists