Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a postgres/postgis table with the columns:

  • gid [PK] serial NOT NULL,
  • geom geometry(MultiPolygon,900913),
  • crop text

My layer in Geoserver however only shows me the feature types "geom" and "crop", the "gid" is not listed. Problem is, I need the gid to update data of a particular (the selected) polygon.

Is there a way to get the gid? If not, how do you bypass this problem?

share|improve this question
look on the layer page and check the expose primary key box – iant Dec 14 '12 at 12:02
up vote 8 down vote accepted

You must to check "expose primary key" in your datastore configuration DataStore configuration

share|improve this answer
Thank you!!! :) – Cat Dec 14 '12 at 13:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.