<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Gustavo,<div><br class="webkit-block-placeholder"></div><div>I'm not exactly clear on how you want to use ST_Dump, but I'll give a shot a some example SQL that might help...</div><div> </div><div><div><blockquote type="cite"> <div><font face="Arial" size="2">I want to convert linestrings from multilinestrings, with linemerge, to obtain united linestrings in overlapping points</font></div> <div><font face="Arial" size="2">with this sentence:</font></div> <div><font face="Arial" size="2"></font><br class="webkit-block-placeholder"></div></blockquote><div><br class="webkit-block-placeholder"></div><div>In your subject you say "multiline to linestring" however. </div><div><br class="webkit-block-placeholder"></div><div>From the astext output below it seems you are saying that you started with multilinestrings and they didn't change after your query. Is that right? </div><div><br class="webkit-block-placeholder"></div><blockquote type="cite"><div><font face="Arial" size="2"><br></font><font face="Arial" size="2">"MULTILINESTRING((4.8938679245283 46.3443396226415,33.313679245283 73.7028301886792,49.5872641509434 80.0707547169811,90.9583136792453 89.2813679245283,54.3363797169811 103.03608490566,29.0620872641509 103.293985849057,12.2125589622641 107.1625,11.1624233831055 106.590266209164,10.4214805264064 107.529010012923,11.2220067193803 108.417488521584,12.2326314413493 107.778056025276),(37.506947728971 97.6302534161404,12.1756482134062 82.9892270906306))"</font></div> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2">with numgeometries=2, the logic result with my original data.</font></div></blockquote><blockquote type="cite"><div><font face="Arial" size="2">How can i extract those linestrings separately?</font></div> <div><font face="Arial" size="2"></font> </div></blockquote><div><br class="webkit-block-placeholder"></div><div>if you want to work with each multilinestring separately then I think you'll want to turn them into two linestrings in two rows.</div><div><br class="webkit-block-placeholder"></div><div>This works for me:</div><div><br class="webkit-block-placeholder"></div><div>--create that test data </div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">create</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">table</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> ml_string (</font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">id</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> serial,</font><font face="Lucida Grande" size="3" color="#777700" style="font: 11.0px Lucida Grande; color: #777700">the_geom</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> </font><font face="Lucida Grande" size="3" color="#990066" style="font: 11.0px Lucida Grande; color: #990066">geometry</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">);</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">insert</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">into</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> ml_string (</font><font face="Lucida Grande" size="3" color="#777700" style="font: 11.0px Lucida Grande; color: #777700">the_geom</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">) </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">values</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> (</font><font face="Lucida Grande" size="3" color="#990066" style="font: 11.0px Lucida Grande; color: #990066">geomfromtext</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">(</font><font face="Lucida Grande" size="3" color="#ff3399" style="font: 11.0px Lucida Grande; color: #ff3399">'</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">MULTILINESTRING((4.8938679245283 46.3443396226415,33.313679245283 73.7028301886792,49.5872641509434 80.0707547169811,90.9583136792453 89.2813679245283,54.3363797169811 103.03608490566,29.0620872641509 103.293985849057,12.2125589622641 107.1625,11.1624233831055 106.590266209164,10.4214805264064 107.529010012923,11.2220067193803 108.417488521584,12.2326314413493 107.778056025276),(37.506947728971 97.6302534161404,12.1756482134062 82.9892270906306))</font><font face="Lucida Grande" size="3" color="#ff3399" style="font: 11.0px Lucida Grande; color: #ff3399">',-1))</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; min-height: 13px; ">--check it as WKT</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">select</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> </font><font face="Lucida Grande" size="3" color="#990066" style="font: 11.0px Lucida Grande; color: #990066">astext</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">(</font><font face="Lucida Grande" size="3" color="#777700" style="font: 11.0px Lucida Grande; color: #777700">the_geom</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">) </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">from</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> ml_string;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; min-height: 13px; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">select</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> g </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">as</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">id</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">, ST_Dump(ST_GeometryN(</font><font face="Lucida Grande" size="3" color="#777700" style="font: 11.0px Lucida Grande; color: #777700">the_geom</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">,g)) </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">from</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> ml_string, generate_series(1,(Select ST_NumGeometries (</font><font face="Lucida Grande" size="3" color="#777700" style="font: 11.0px Lucida Grande; color: #777700">the_geom</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">) </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">from</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> ml_string)) </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">as</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> g;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-style-span" style="font-size: 11px; ">--which is the nearly the same as directly calling ST_Dump on your multilinestring:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-style-span" style="font-size: 11px; "><span class="Apple-style-span" style="font-size: 12px; "><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">select</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> ST_Dump(</font><font face="Lucida Grande" size="3" color="#777700" style="font: 11.0px Lucida Grande; color: #777700">the_geom</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande">) </font><font face="Lucida Grande" size="3" color="#0000cc" style="font: 11.0px Lucida Grande; color: #0000cc">from</font><font face="Lucida Grande" size="3" style="font: 11.0px Lucida Grande"> ml_string;</font></span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Sorry if I am off track. Just send another note with clarification if you can...</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Dane</div></div></div></div></div></body></html>