<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix"><br>
</div>
<blockquote cite="mid:56686687.2050701@videotron.ca" type="cite">I
would like to use selectedFeaturesIds() but I can't rely on ids
returned being the actual PK.</blockquote>
A way to circumvent the PK identification issue on a PG view : <br>
<br>
- 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<br>
- save the project file<br>
- open project file in a text editor, search <b>key='</b> and check
the value corresponds to the actual field name you want in postgis
<maplayer> items; if not, change it<br>
- reopen QGIS and voilĂ : keyColumn() returns the expected value and
selectedFeaturesIds() too<br>
<br>
Yves <br>
<br>
<br>
</body>
</html>