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?

  • 2
    look on the layer page and check the expose primary key box
    – Ian Turton
    Commented Dec 14, 2012 at 12:02

2 Answers 2


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

  1. Go to the stores on the GeoServer webpage left bar
  2. Select your store from the list
  3. On the middle position you will find an option expose primary key
  4. Check it. Now you will find the pk and can run any operation with it

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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