assuming that your data is correct., try this:
SELECT ST_GeomFromText('LINESTRING(' || a.start || ' , ' || a.end || ')') FROM (
SELECT ST_StartPoint(geom) as start, ST_EndPoint(geom) as end FROM roads) as a
SELECT ST_GeomFromText('LINESTRING(' || a.start || ' , ' || a.end || ')') FROM ( SELECT ST_StartPoint(geom) as start, ST_EndPoint(geom) as end FROM roads) as a (not tested, probably has syntax errors).
Add WHERE clause if needed.