By David Crowther
When I connect to my PostGIS datasets via QGIS or Autodesk Map 3D I cannot edit the attributes or insert new records, what is the cause of this?
Firstly ensure that the User accessing the PostGIS data has the correct login credentials to make edits to the PostGIS database.
Once you are sure that the issue is not related to permissions, you may find that the likely reason is that there is no Primary Key assigned to your PostGIS table. Without a Primary Key a client application such as QGIS or Autodesk Map 3D will be able to view the data but not make edits.
To create a Primary Key you will need a field in your PostGIS Table that contains a unique value. If this exists, then simply turn on the Primary Key Switch in your Tables Properties:
If your table does not have an existing unique ID field, then you can simply use the script below to create a new field called FID, update that with unique values and create the Primary Key automatically:
Note – the Table is called Rotterdam_trafficsigns and is stored in the Netherlands Schema within the database.
Once the PostGIS table has a field assigned as the Primary Key the next time you open that table within your GIS the table will be editable.