It's necessary to calculate the actual intersection, e.g. http://postgis.net/docs/ST_Intersection.html
SELECT ST_Length(ST_Intersection(line,polygon))
It's necessary to calculate the actual intersection, e.g. http://postgis.net/docs/ST_Intersection.html
SELECT ST_Length(ST_Intersection(line,polygon))