I have two different layers, the pink and the blue one. The green polygon is given by the intersection of the other two layers. I want to calculate the length of the common boundary line between the green and the pink layer.
I have already tried this query but for some reason it doesn't compute anything:
select pink.id as pink_id,
st_intersection(pink.geometry, green.geometry) as geometry,
st_length(st_intersection(pink.geometry, green.geometry)) as border_length
from pink_layer as pink
join green_layer as green
ON st_intersects(pink.geometry, green.geometry)
AND pink.id = green.id