Using 10.2 Arcmap/ArcGIS Server on Windows with PostgreSQL 9.2/PostGIS 2.0. I'm try to publish a Feature Access service with all the Operations and Capabilities enabled against a purely PostGIS table (not using Esri's ST_GEOMETRY type). However, when publishing I get this blocking error during the ArcMap validation part.
"00166: Layer's ObjectID is not maintained by the database and the feature service is being published with Create capability enabled"
What are the rules for creating PostGIS tables that ArcGIS Server 10.2 can use for publishing a Feature Access service with the Create function enabled?
Take a look at this web-link. It might help you.
Piggybacking off of what Nidhin said, try to use the Add Incrementing ID Field tool within the Toolbox. This ensures the ObjectID created is consistent with whatever ArcMap/ArcGIS Server requires for that field, in terms of the triggers and sequences.
http://forums.arcgis.com/threads/98624-Data-type-for-auto-incrementing-OBJECTID-in-Postgres ) which is that Esri does support the Serial data type shortcut for creating incrementing IDs in postgres. I've been running everything as the postgres user so permissions shouldn't be an issue.
But I'm still stumped as to why I'm getting this error (and perhaps relatedly why the tool in this link also fails to work and errors without offering a useful message). I've tried many permutations on the table defs, and I even tried calling the incrementing PK something other than "objectid" and running these tools. I also tried calling it "OBJECTID" only to later read that all caps won't work for Esri.