By means of the QGIS 3.16.3 I have created a GeoPackage with two layers, a point layer and a polygon layer.

The point layer is named "pt", with attributes: geometry, sN, sE, sS, sW, uuid.

The polygon layer is named "crown", with attributes: geometry, pt_uuid.

I can add a point to "pt" or a polygon to "crown", but cannot save the layer edits. I get the following error:

Could not commit changes to layer pt Errors: ERROR: 1 feature(s) not added. Provider errors: OGR error creating feature -35: failed to prepare SQL: INSERT INTO "pt" ( "geometry", "sN", "sE", "sS", "sW", "uuid") VALUES (?, ?, ?, ?, ?, ?)

Does anyone know what I am doing wrong?

  • 2
    Presumably uuid is the 'unique' identifier. Is it actually unique? If it is not, then writing will fail. Perhaps the features you are adding are attempting to use a value that has already been used.
    – Matt
    Commented Oct 17, 2021 at 16:53
  • Hi Matt. "uuid" is unique.
    – Oisin
    Commented Oct 18, 2021 at 11:38


Your Answer

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

Browse other questions tagged or ask your own question.