I'm working with PostGIS 2.1.8. I need to split a polyline into as many straight segments this polyline contains. Here is an illustration to make it clear enough:
The initial feature is only one row and the query should produce a 4 rows result with attributes values being maintained and geometry column changed (I don't want to update length column):
# Initial table:
id | name | length | the_geom
-----+---------+----------+-----------------
1 | Line 1 | 12.2 | 01000111100000
# Result table:
id | name | length | the_geom
-----+---------+----------+-----------------
1 | Line 1 | 12.2 | 01000111100000
2 | Line 1 | 12.2 | 01001111000011
3 | Line 1 | 12.2 | 01000110010000
4 | Line 1 | 12.2 | 00000111100000
I have found the function st_subdivide() (see here) but it is available from PostGIS version 2.2... I can't upgrade my PostGIS version because I'm at work and not allowed to do it.
Any idea on how to achieve that with an older than 2.2 PostGIS version?
