Take for instance a very complex line string.. which has WKT like this LINESTRING(1 1,2 2,3 3,4 4,5 5 ...)
I want to create two-point linestrings from many-point linestrings.
SELECT ST_MakeLine(ST_MakePoint(x,x)) AS l
FROM generate_series(1,10) AS x
To break down into simple linestrings between all points.
linesegment
-----------------------
LINESTRING(1 1,2 2)
LINESTRING(2 2,3 3)
LINESTRING(3 3,4 4)
LINESTRING(4 4,5 5)
LINESTRING(5 5,6 6)
...