<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><a class="moz-txt-link-freetext" href="https://gis.stackexchange.com/questions/49950/converting-mulitlinestring-to-linestring-in-postgresql-with-postgis/49994">https://gis.stackexchange.com/questions/49950/converting-mulitlinestring-to-linestring-in-postgresql-with-postgis/49994</a></p>
    <p>If you simply want to have a single type in your table it's much
      easier to convert the linestrings to mutilinestrings using this
      command like this<br>
    </p>
    <pre class="lang-sql prettyprint prettyprinted" style=""><code><span class="kwd">ALTER</span><span class="pln"> </span><span class="kwd">TABLE</span><span class="pln"> my_table
    </span><span class="kwd">ALTER</span><span class="pln"> </span><span class="kwd">COLUMN</span><span class="pln"> geom TYPE geometry</span><span class="pun">(</span><span class="pln">MultiLineString</span><span class="pun">,</span><span class="lit">4326</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">USING</span><span class="pln"> ST_Multi</span><span class="pun">(</span><span class="pln">geom</span><span class="pun">);</span></code></pre>
    <p>(You'll have change the above command regarding table- and column
      names  and crs id)</p>
    <pre class="moz-signature" cols="72">-- 
Med venlig hilsen / Kind regards

Bo Victor Thomsen</pre>
    <div class="moz-cite-prefix">Den 02-09-2019 kl. 09:23 skrev
      <a class="moz-txt-link-abbreviated" href="mailto:paul.malm@lfv.se">paul.malm@lfv.se</a>:<br>
    </div>
    <blockquote type="cite"
      cite="mid:785199B14156764C8EB14EF96CEDC44EE28E65@xw-exch03.lfv.se">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-postmall17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I have a table
            (bufferedlines) with a geometry column (the_geom)  including
            both Linestrings and MultiLinestrings, what is the easiest
            way to change the_geom to a Linestring column?<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Kind regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Paul  <o:p></o:p></span></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/postgis-users">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></pre>
    </blockquote>
    <pre class="moz-signature" cols="72">
</pre>
  </body>
</html>