<html><head></head><body>Please stop saying this. It's fine for certain situations, but it is not a permanently unique identifier for a row.  It may change when the underlying table is altered. Sure, it's unique if you read the results and keep them in memory and never talk about it again, but qgis does that on its own already.<br>
<br>
Moreover querying on it is extremely inefficient. Querying against it forces a sequence scan on the table. Depending on the table and version, it could also try to materialize the view fully in memory before doing the scan.<br>
<br>
Jim<br><br><div class="gmail_quote">On September 1, 2015 11:31:32 AM EDT, "Leknín Řepánek" <godzilalalala@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Workaround about primary key in view, i had use sever times is using<br />window function "row_number() over()". It works in views and in query<br />from database manager.<br /><br />Je;<br /><br />On Tue, Sep 01, 2015 at 04:09:49PM +0200, Sandro Santilli wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> On Tue, Sep 01, 2015 at 02:37:22PM +0200, Jürgen E. Fischer wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> Hi Sandro,<br /> <br /> On Tue, 01. Sep 2015 at 13:48:33 +0200, Sandro Santilli wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"> I agree with Luca this should have been better not backported to 2.8.3.<br /> Only proper bugs should be backported, and this was a (debatable)<br /> GUI enhancement, as far as I can
tell.<br /></blockquote> <br /> We intend to only backport fixes and not bugs. ;)<br /> <br /> You were always supposed to select the key column - preselecting the first<br /> column was the bug (also debatable).  And #11317 is a ticket that demonstrates<br /> there were unaware users.<br /></blockquote> <br /> Reading #11317 I looks to me that the reported bug was about<br /> "Add PostGIS Layer" not giving the user full detail of why a<br /> layer could not be loaded: "is an invalid layer - not loaded".<br /> In this I agree with Aren here: <a href="http://hub.qgis.org/issues/11317#note-6">http://hub.qgis.org/issues/11317#note-6</a><br /> <br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> That the first column often happens to be the primary key and and the combobox<br /> is not lexically sorted is somewhat pure luck - and unless you avoid having the<br /> key verified (using "use estimated metadata"),
keeping a wrongly select<br /> column will make the layer to insert invalid.<br /></blockquote> <br /> I agree that the reported regression was based on the false expectation<br /> that QGIS would pick a primary key automatically, but in the<br /> (unlikely?) case a user was aware of that and properly coded the view<br /> to ensure primary key was first (or only) numeric the change was<br /> indeed a degradation of the experience.<br /> <br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> But I agree that the tooltip that you get on disabled lines (not only for the<br /> key selection, but also geometry type and srid) might not be visible enough<br /> (but that IMHO would be just a GUI enhancement).<br /></blockquote> <br /> There should maybe be another rule about LTS backports being:<br /> debatable fixes/enhancement need to be debated more on list ?<br /> <br /> --strk;<br /><hr /><br /> Qgis-user mailing
list<br /> Qgis-user@lists.osgeo.org<br /> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /></blockquote><hr /><br />Qgis-user mailing list<br />Qgis-user@lists.osgeo.org<br /><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>