Is there a PostGIS function that will convert a POLYGON type to a LINESTRING? I'm trying to understand the details of geometries by taking one apart, but NumPoints() requires a LINESTRING and Geometry(the_geom,1) returns a POLYGON.