Hi again!

I am trying to add a feature to a PostGIS table, in which there is a serial primary key 'id'.

Without defining id, here is what I get when I try addFeatures:
ERROR: null value in column "id" violates not-null constraint

and I tried
iid  = self.layer.dataProvider().fieldNameIndex('id')
if iid != -1: f.addAttribute(iid,'nextval(distribution.dimension_id_seq::regclass)')
which leaded to
ERROR: invalid input syntax for integer: "nextval(distribution.dimension_id_seq::regclass)"

Is there a bug in the provider, or should I get first the new id (if yes, how do I do this) ?

Thanks a lot!
Denis



_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to