<div dir="ltr">Sorry...I figured out the problem...I had manually entered one line of data into the table in PostGIS so the pkey 1 already existed, by deleting this row there was no problem appending</div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-29 15:41 GMT-04:00 Chrystel Losier <span dir="ltr"><<a href="mailto:chrystel.losier@reseauzec.com" target="_blank">chrystel.losier@reseauzec.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">I am fairly new to PostGIS and need to append data
from a shp to an already existing table in PostGIS. All the columns from the
shp and the table are the same, except that the shp does not already contain the
geometry column and the primary key column. I am using the following command
line to append the data : </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">"C:\Program
Files\PostgreSQL\9.3\bin\shp2pgsql.exe" 
-g the_geom -W latin1 -s 900913 -a peche_gue_final_projeter.shp corpo.peche_gue  | "C:\Program
Files\PostgreSQL\9.3\bin\psql.exe" -h <a href="http://demo.spatialytics.com" target="_blank">demo.spatialytics.com</a> -d zec_quebec
-U jlabelle –q</span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">I get the following error message :</span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">Error : duplicate key value violates unique
constraint « peche_gue_pkey »</span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">Details : Key « id_p_gue » = « 1 »
already exists. </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">The table in PostGIS to which I want to append data
already has a primary key column : . « id_p_gue » which is
in serial. </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">Any ideas how to deal with this problem? </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial"> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:12pt;font-family:Arial,sans-serif;background-image:initial;background-repeat:initial">Thanks!</span></p></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a 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></div>