Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm adding new features to a polygon datasets in QGIS. The data is held in PostGIS but when i have a look at the attribute table for the polygon the gid field is not automatically updating, the entry reads NULL

I'm editing under the postgres login which looking at the sequeneces in PGadmin says that

ALTER TABLE parking_enforcement.restrictions_gid_seq OWNER TO postgres;

Is there anything special that i need to be doing in Postgres?

share|improve this question
    
use ALTER SEQUENCE postgresql.org/docs/8.1/static/sql-altersequence.html incremental option –  Mapperz Sep 14 '12 at 14:07
    
If there are a few NULL records in the column will this automatically add a unique value? –  geosmiles Sep 14 '12 at 18:23
add comment

1 Answer

up vote 3 down vote accepted

I'm guessing your gid column is not a serial or doesn't have a default value set to nextval(..).

http://www.postgresql.org/docs/9.0/interactive/datatype-numeric.html#DATATYPE-SERIAL

share|improve this answer
add comment

Your Answer

 
discard

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.