Yet another interesting function is
ST_Touches(geometryA, geometryB). This function checks whether two geometries touch each other at their boundaries. In other words, it's a collision-detection function. Note that the two geometries cannot have any interior space in common.
This function can be used to find neighboring districts, additional segments/extensions of bicycle routes, and much more. Take a look at the following query:
FROM sf_bicycle_routes s1
JOIN sf_bicycle_routes s2
ON ST_Touches(s1.course, s2.course)
The query above will find all the bicycle routes that connect to the another bicycle route at one point.