What I want to do is make the purple layer at the back having the same shape as the transparent layer.
Just figured it out. Not sure if it helps anyone by answering my own question
UPDATE blue b SET geom = ST_Intersection(b.geom, p.geom) FROM purple p WHERE ST_Intersects(b.geom, p.geom);
It gets the geometry of the intersection and use it to replace the one in the original table