<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Luciano,<br>
    <br>
    I think I'm not understanding your goal. Do you have a shapefile
    that contains a mix of towns, neighborhoods, blocks and streets? Are
    you trying to load the shapefile but break the features up so that
    towns get inserted in a PostGIS towns table, neighborhoods get
    inserted in a PostGIS neighborhoods table, etc.? <br>
    <br>
    Best,<br>
    --Lee<br>
    <br>
    <div class="moz-cite-prefix">On 04/18/2015 12:22 PM, James Keener
      wrote:<br>
    </div>
    <blockquote
      cite="mid:8C22122C-72E9-4EA5-8573-39EB7F2A9CCE@jimkeener.com"
      type="cite">I guess I'm still not fully understanding the problem.
      I don't understand what problem the normalization is causing you.
      You shouldn't need to duplicate the rows in different tables when
      you duplicate one in another table.<br>
      <br>
      To edit fields in QGIS you need to enable editing on the layer and
      then you can get end editable form for each feature or you can
      edit directly in the attribute table. Copy and pasting features in
      QGIS copied all of the attributes as well.<br>
      <br>
      Can you give a more complete example of the issue you're facing?<br>
      <br>
      Jim<br>
      <br>
      Jim<br>
      <br>
      <div class="gmail_quote">On April 18, 2015 12:11:38 PM EDT,
        Luciano <a class="moz-txt-link-rfc2396E" href="mailto:br.analistagis@gmail.com"><br.analistagis@gmail.com></a> wrote:
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div dir="ltr">
            <div><span id="result_box" class="" lang="en"><span class="">Yes</span><span
                  class="">, I'm using</span> <span class="">QGIS</span><span>.</span>
                <span class="">I agree</span><span>,</span> <span
                  class="">if I make a</span> <span class="">table</span>
                <span class="">in the database</span> <span class="">with
                  the same structure</span> <span class="">the shape
                  file</span> <span class="">is simple.</span> <span
                  class="">The</span> <span class="">copy / paste</span>
                <span class="">works perfectly</span><span>.</span><br>
                <span class="">But</span> <span class="">my question</span>
                <span class="">is</span> <span class="">how to update</span>
                <span class="">for example</span> <span class="">the</span>
                <span class="">blocks</span> <span class="">table</span><span>,</span>
                <span class="">using the</span> <span class="">copy /
                  paste,</span> <span class="">since</span> <span
                  class="">the database</span> <span class="">structure
                  is</span> <span class="">different.</span><br>
                <span class="">For example</span><span>,</span> <span
                  class="">if I copy</span> <span class="">a polygon</span>
                <span class="">layer</span> <span class="">shape</span><span>,</span>
                <span class="">and try to</span> <span class="">stick
                  to the</span> <span class="">database</span> <span
                  class="">layer</span><span>, the fields</span> <span
                  class="">of the new</span> <span class="">polygon</span>
                <span class="">will be</span> <span class="">void.</span><br>
                <span class="">Note that</span> <span class="">my</span>
                <span class="">database</span> <span class="">blocks</span>
                <span class="">table does not have</span> <span
                  class="">the same structure</span> <span class="">of
                  the</span> <span class="">shape file</span> <span
                  class="">because it</span> <span class="">is</span> <span
                  class="">normalized</span> <span class="">(or should
                  be</span><span>), so</span> <span class="">the fields</span>
                <span class="">of</span> <span class="">two data
                  sources</span> <span class="">do not
                  match.</span><br>
                <span class="">In this case</span><span>, what is the</span>
                <span class="">best</span> <span class="">practice?<br>
                  <br>
                </span></span></div>
            <span id="result_box" class="" lang="en"><span class="">tia<br>
              </span></span></div>
          <div class="gmail_extra"><br>
            <div class="gmail_quote">2015-04-18 12:44 GMT-03:00 James
              Keener <span dir="ltr"><<a moz-do-not-send="true"
                  href="mailto:jim@jimkeener.com" target="_blank">jim@jimkeener.com</a>></span>:<br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">tl;dr:
                Have you tried QGIS?<br>
                <br>
                What were you using to copy/paste before?  I didn't
                think straight<br>
                editing of the DBaseIII files directly was a sane thing
                to do, as<br>
                they're linked up with the shape and shape-index files.<br>
                <br>
                PostGIS is just a PostgreSQL database, so any editor
                that can allow you<br>
                to edit/duplicate PostgreSQL tables could work.  As for
                mutating<br>
                geometries, maybe QGIS?  That would also allow you to
                edit geometries,<br>
                attributes, as well as duplicate features.<br>
                <br>
                Hope that helps,<br>
                Jim<br>
                <div>
                  <div class="h5"><br>
                    On 04/18/2015 11:39 AM, Luciano wrote:<br>
                    ><br>
                    > Hi,<br>
                    > I wonder how can I update a postgresql postgis
                    database before the<br>
                    > following scenario:<br>
                    > Always worked with shape files and update them
                    used copy / paste between<br>
                    > files.<br>
                    > Now, think about creating a database in
                    PostgreSQL and would like to<br>
                    > continue using copy / paste to update polygons,
                    but in my database<br>
                    > structure is different from the shape file. For
                    example:<br>
                    > Imagine that the shapefile have all the fields
                    in one table, already in<br>
                    > the database, by reason of standardization,
                    have these columns in tables<br>
                    > distinct. Below is an example of a register of
                    towns.<br>
                    ><br>
                    > File shape, columns:<br>
                    > town ​​code;<br>
                    > town description;<br>
                    > Neighborhood code;<br>
                    > name of the neighborhood;<br>
                    > block code;<br>
                    > Street code;<br>
                    > street name;<br>
                    ><br>
                    > In Postgres / Gis could look like this:<br>
                    ><br>
                    > Cities table (data):<br>
                    > - Town id<br>
                    > - Description of town<br>
                    ><br>
                    > Neighborhoods table (data):<br>
                    > - Id of the neighborhood<br>
                    > - Description of the neighborhood<br>
                    > - Id of town (foreign key)<br>
                    ><br>
                    > Blocks table:<br>
                    > - Id of the court<br>
                    > - Block of code<br>
                    > - Town id (foreign key)<br>
                    > - Geometry, polygon<br>
                    ><br>
                    > Streets table:<br>
                    > - Street id<br>
                    > - Street name<br>
                    > - Town id (foreign key)<br>
                    > - Geometry, line<br>
                    ><br>
                    > How could update (insert) a block in postgresql
                    table using copy / paste<br>
                    > the shape file?<br>
                    > Would have to create a trigger/procedure
                    (instead of) to automate the<br>
                    > process?<br>
                    > Fields of shape file should be equal to the
                    fields of database table?<br>
                    > Some practical example as a reference?<br>
                    ><br>
                    > tia<br>
                    > --<br>
                    > Luciano<br>
                    ><br>
                    ><br>
                    ><br>
                  </div>
                </div>
                > _______________________________________________<br>
                > postgis-users mailing list<br>
                > <a moz-do-not-send="true"
                  href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
                > <a moz-do-not-send="true"
                  href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users"
                  target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
                ><br>
                <br>
                <br>
                _______________________________________________<br>
                postgis-users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users"
                  target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
              </blockquote>
            </div>
            <br>
            <br clear="all">
          </div>
        </blockquote>
      </div>
      <br>
      -- <br>
      Sent from my Android device with K-9 Mail. Please excuse my
      brevity.
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Lee Hachadoorian
Assistant Professor in Geography, Dartmouth College
<a class="moz-txt-link-freetext" href="http://geospatial.commons.gc.cuny.edu">http://geospatial.commons.gc.cuny.edu</a>
<a class="moz-txt-link-freetext" href="http://freecity.commons.gc.cuny.edu">http://freecity.commons.gc.cuny.edu</a>
</pre>
  </body>
</html>