<div dir="ltr"><span style="font-size:12.8000001907349px">I finally managed what I wanted, and that is to be able to edit geometries stored in PostgreSQL/PostGIS (non versioned) with both ArcMap and QGIS following this steps :</span><div style="font-size:12.8000001907349px">- With pgAdmin create a new database using "template_postgis_20" (let's name it database)</div><div style="font-size:12.8000001907349px">- From ArcCatalog - System Toolboxes - Data Management Tools - Geodatabase Administration - Create Enterprise Geodatabase "esrifi" your previously created database (In the Database field write the name of the database previously created with pgAdmin)</div><div style="font-size:12.8000001907349px">-From ArcCatalog - Add Database Connection - connect to your "esrified" geodatabase using sde superuser credentials (previously created). A new connection will be created.</div><div style="font-size:12.8000001907349px">-Right click on the newly created connection - Administration - Add user (adrian)</div><div style="font-size:12.8000001907349px">-Disconnect as sde and  connect back to the database with the new user's credentials. Here is a trick. ArcMap have a latency in disconnecting the previous connection. So, delete the previous sde connection and restart ArcMap or do whatever you now to be sure that you are connecting as the newly created user.</div><div style="font-size:12.8000001907349px">-Connected as newly created user - Right click on connection - Import - Feature classes and don't forget here at the bottom of the dialogue box "Geodatabase Settings (optional)" to choose PG_GEOMETRY</div><div style="font-size:12.8000001907349px">-Go back in pgAdmin and in the user's schema (not SDE schema) :</div><div style="font-size:12.8000001907349px">1. Define a primary key on objectid column :</div><div style="font-size:12.8000001907349px"><div>ALTER TABLE adrian.database</div><div>  ADD CONSTRAINT objectid_pkey PRIMARY KEY(objectid);</div></div><div style="font-size:12.8000001907349px">2.Create a sequence :</div><div style="font-size:12.8000001907349px"><div>CREATE SEQUENCE adrian.databse_objectid_sequence</div><div>  INCREMENT 1</div><div>  MINVALUE 1</div><div>  MAXVALUE 9223372036854775807</div><div>  START 6324</div><div>  CACHE 1;</div><div>ALTER TABLE adrian.database_objectid_sequence</div><div>  OWNER TO adrian;</div></div><div style="font-size:12.8000001907349px">3.Autoincrement objectid column values according to the corresponding sequence.</div><div style="font-size:12.8000001907349px">ALTER TABLE adrian.database ALTER COLUMN objectid SET DEFAULT nextval('adrian.database_objectid_sequence'::regclass);<br></div><div style="font-size:12.8000001907349px">That will be all.</div><div style="font-size:12.8000001907349px">Adrian</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 16, 2015 at 10:01 AM, Paolo Importuni <span dir="ltr"><<a href="mailto:imppao@gmail.com" target="_blank">imppao@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi Adrian,<br>as far as I can remember there are two parameters in the table sde 'db_tune' that must be set to the PG_GEOMETRY type.  I remember having the same problem some times ago, due to the fact that I had set only one parameter to the right type.<br><br></div>Then, of course, you will have to delete your geometry type and re-import it.<br><br></div>Let us know if you sort it out.<br><br></div>regards<br><br></div>paolo<br><div><div><div><div><br><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-15 21:23 GMT+01:00 Adrian Term <span dir="ltr"><<a href="mailto:adrian.term@gmail.com" target="_blank">adrian.term@gmail.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"><div>I have the following setup :</div><div>ArcGIS 10.2.2 for Desktop Advanced</div><div>ArcGIS 10.2.2 for Server</div><div>QGIS 2.6.1 Brighton</div><div>PostgreSQL 9.2.9-3</div><div>PostGIS 2.1</div><div><br></div><div>I managed to make them all hear each other following this instructions : <a href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002p000000t4000000" target="_blank">http://resources.arcgis.com/en/help/main/10.2/index.html#//002p000000t4000000</a></div><div>Data is loaded  from ArcGIS with the <span style="font-size:13px">"Import feature class (single)"</span><span style="font-size:13px">  with the "PG_Geometry" configuration keyword in Geodatabase Settings.</span></div><div>With ArcGIS I can connect, view, edit and save the data stored in the "esrified" PostgreSQL/PostGIS  database tables.</div><div><br></div><div>Unfortunately, when<span style="font-size:13px"> I try to do the same thing in QGIS i get an error message :</span></div><div><span style="font-size:13px">"Errors: ERROR: 1 feature(s) not added.</span></div><p style="font-size:13px;margin:0px"></p><p style="font-size:13px;margin:0px">Provider errors:</p><p style="font-size:13px;margin:0px">PostGIS error while adding features: ERROR: column "shape" is of type geometry but expression is of type st_geometry"</p><p style="font-size:13px;margin:0px">On the other hand, I tried to do the same thing with UDIG and everything works perfect.</p><p style="font-size:13px;margin:0px"><br></p><p style="font-size:13px;margin:0px">I assume that the issue in QGIS is something about what Birgit mentioned :</p><p style="font-size:13px;margin:0px">"<span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif">If ArcGIS writes geometries into the PostgreSQL database it names the geometry column as "shape" with the datatype "geometry" </span></p><p style="font-size:13px;margin:0px"><br></p><p style="font-size:13px;margin:0px"><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif">Any ideas ?</span></p><span><font color="#888888"><p style="font-size:13px;margin:0px"><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif">Adrian</span></p><p style="font-size:13px;margin:0px"><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif"><br></span></p><p style="font-size:13px;margin:0px"><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif"><br></span></p><p style="font-size:13px;margin:0px"><br></p><p style="font-size:13px;margin:0px"><br></p><p style="font-size:13px;margin:0px"><br></p><p style="font-size:13px;margin:0px"><br></p><div><br></div><div><br></div></font></span></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">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>
<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>