<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
    <style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#FFFFFF"
    text="#000000">
    <br>
    <div class="moz-cite-prefix">On 12/06/2014 02:32 PM, Alessio
      Degioannini wrote:<br>
    </div>
    <blockquote cite="mid:5482F75A.4020500@proterstudio.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      Hi,<br>
      I'm a postgis/postgres newbie and I <span id="result_box"
        class="" lang="en"><span class="hps">I would like to</span> <span
          class="hps">get some help</span> <span class="hps">on the
          topics</span> <span class="hps">that</span> <span
          class="hps">I'm going to</span> <span class="hps">describe.<br>
        </span></span><br>
      <div id="gt-src-tools">
        <div id="gt-src-tools-l">
          <div style="display: inline-block;" id="gt-input-tool">
            <div id="itamenu"><span class="ita-kd-inputtools-div"></span></div>
          </div>
        </div>
      </div>
      <div id="gt-res-content" class="almost_half_cell">
        <div dir="ltr" style="zoom:1">
          <div id="tts_button"><object
              type="application/x-shockwave-flash"
              data="//ssl.gstatic.com/translate/sound_player2.swf"
              id="tts" height="18" width="18"></object></div>
          <span id="result_box" class="" lang="en"><span class="hps">I
              have</span> <span class="hps">imported into the database</span>
            <span class="hps">the shapefile</span> <span class="hps">"survey"

              of points</span> <span class="hps atn">(</span><span>trees</span><span>)</span><span>.</span>
            <span class="hps">The</span> <span class="hps">spatial</span>
            <span class="hps atn">table "</span><span>survey</span><span>"</span>
            <span class="hps">contains</span> <span class="hps">five</span>
            <span class="hps">columns</span><span>:</span><br>
            <span class="hps">-</span> <span class="hps atn">"</span><span>Gid</span><span>"</span>
            <span class="hps atn">(</span><span>created</span> <span
              class="hps">during import and</span> <span class="hps">primary

              key</span><span>, integer)</span><br>
            <span class="hps">-</span> <span class="hps atn">"</span><span>Id</span><span>"</span><br>
            <span class="hps">-</span> <span class="hps">"Code</span><span>"</span><br>
            <span class="hps">-</span> <span class="hps atn">"</span><span>Old

              number</span><span>"</span><br>
            <span class="hps">-</span> <span class="hps atn">"</span><span>Geom</span><span>"</span>
            <span class="hps atn">(</span><span>it</span> <span
              class="hps">also</span> <span class="hps">created</span>
            <span class="hps">during import</span><span class="">).<br>
            </span></span><span id="result_box" class="" lang="en"><span
              class="hps"><br>
            </span></span><span id="result_box" class="" lang="en"><span
              class="hps">The database includes</span> <span class="hps
              alt-edited">several tables</span> <span class="hps atn">(</span><span
              class="hps">"Species</span><span>"</span><span>,</span> <span
              class="hps atn">"</span><span>Defects</span><span>"</span><span>,</span>
            <span class="hps atn">"</span><span>Disease</span><span>"</span>
            <span class="hps">and</span> <span class="hps alt-edited">others</span><span>)</span>
            <span class="hps">related</span> <span class="hps">to the
              main table</span> <span class="hps atn">"</span><span>VTA</span><span>"</span><span>.</span><br>
            <span class="hps">Now I would like</span> <span class="hps">to

              know why</span><span>,</span> <span class="hps">unlike
              what happened</span> <span class="hps">to</span> <span
              class="hps">the other</span> <span class="hps">tables,</span>
            <span class="hps">I can not connect</span> <span
              class="hps">with</span> <span class="hps atn">"</span><span
              class="">ADD</span> <span class="hps">CONSTRAINT</span><span>"</span>
            <span class="hps">column</span> <span class="hps atn">"</span><span>code</span><span>"</span>
            <span class="hps">(integer</span><span>, not null</span><span>,</span>
            <span class="hps">unique)</span> <span class="hps atn">of
              the table "</span><span>VTA</span><span>"</span> <span
              class="hps">to the corresponding</span> <span class="hps">column</span>
            <span class="hps atn">"</span><span>code</span><span>"</span>
            <span class="hps">(also</span> <span class="hps">integer</span><span>,
              not null</span><span>)</span> <span class="hps">the</span>
            <span class="hps">spatial</span> <span class="hps atn">table

              "</span><span>survey</span><span>"</span><span>.</span><br>
            <br>
          </span></div>
      </div>
    </blockquote>
    <br>
    Maybe you already have some values in the code column of VTA which
    do not exist in the code column of the survey table? You can not
    create a constraint when existing data already violate the
    constraint.<br>
    <br>
    <blockquote cite="mid:5482F75A.4020500@proterstudio.com" type="cite">
      <div id="gt-res-content" class="almost_half_cell">
        <div dir="ltr" style="zoom:1"><span id="result_box" class=""
            lang="en"> <span class="hps">Another question</span><span>:</span>
            <span class="hps">when I'm</span> <span class="hps">editing
              a</span> <span class="hps">field</span> <span class="hps
              atn">(</span><span class="">for</span> <span class="hps">example</span>
            <span class="hps atn">"</span><span class="">species name</span><span>"</span>
            <span class="hps atn">in the column "</span><span class="">species</span><span
              class="">" of table</span> <span class="hps atn">"</span><span>VTA</span><span>"</span><span>,</span>
            <span class="hps">related</span> <span class="hps">to the
              table</span> <span class="hps">"Species</span><span>"</span><span>,</span>
            <span class="hps">would that</span> <span class="hps">"species</span>
            <span class="hps">name"</span> <span class="hps">could</span>
            <span class="hps">be</span> <span class="hps">completed</span>
            <span class="hps">on the basis</span> <span class="hps">of
              the records</span> <span class="hps">in the table</span>
            <span class="hps">"Species</span><span>"</span><span>.</span></span>
          How can I do this?<br>
          <span id="result_box" class="short_text" lang="en"><span
              class="hps">Thanks in advance.<br>
              <br>
              Alessio<br>
              <br>
            </span></span><br>
        </div>
      </div>
      <br>
      <br>
      <br>
      This mail was received via Mail-SeCure System.<br>
      <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>
This mail was received via Mail-SeCure System.


</pre>
    </blockquote>
    <br>
  </body>
</html>