I am using QField with QGIS to collect data in the field, in offline mode. My data are stored in a PostGIS database I manage. I used QFieldSync to package my QGIS project and was able to open it on my Android device and edit/add features just fine. The layer to be edited on the field has a 'gid' primary key, of type serial, not null, in the database.
What happens is that on field, when I split a feature in this layer, the new part doesn't get a new 'gid', and the field value remains null. Of course when I synch data back to the project on the fixed PC the new features are not inserted in the database, and are lost. What I need to do to be able to collect data offline on the field and bring them back in my PostGIS database? (offline is required, can't have a network connection).