I would like to use selectedFeaturesIds() but I can't rely on ids
returned being the actual PK.
A way to circumvent the PK identification issue on a PG view :
- load layers whichever way (browser, DB Manager, etc.); at this time
keyColumn() on a QgsDataSourceURI object made from that layer will be
whatever int4 field is the most probable candidate for a PK
- save the project file
- open project file in a text editor, search *key='* and check the value
corresponds to the actual field name you want in postgis <maplayer>
items; if not, change it
- reopen QGIS and voilà : keyColumn() returns the expected value and
selectedFeaturesIds() too
Yves
_______________________________________________
Qgis-user mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user