[Qgis-developer] incorrect feature IDs with Postgresql table without primary key

Denis Rouzaud denis.rouzaud at gmail.com
Thu Aug 11 01:26:55 PDT 2016


Hi, 

I just noticed that feature.id() always return 1 when iterating on a
postgresql layer which has no single column primary key.

Using the demo data qgis_test.book_authors, in console writing, 

for f in iface.activeLayer().getFeatures():
  f.id()

prints out

1
1
1
1

Anyone knows where the issue come from?

Thanks,

Denis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160811/914cf16a/attachment.html>


More information about the Qgis-developer mailing list