<html><head></head><body>We also need to ask what qgis is doing with this and why we need to bug the user about it at all. <br>
<br>
Why do we not big the user about tables without a primary key? If tables can be loaded without a pk, why can't views.<br>
<br>
Why can I select non-unique columns as primary keys and after loading the layer get no error?<br>
<br>
Are these also bugs? Should I make (or find?) tickets for them?<br>
<br>
Jim<br><br><div class="gmail_quote">On September 1, 2015 11:49:23 AM EDT, Matthias Kuhn <matthias@opengis.ch> 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">Hi,<br /><br />I would like to second Andreas, what we need is an improvement in the UI<br />to make the user aware of the problem.<br /><br />My proposal (please review and improve!!!!)<br /><br />1. Let the user choose whatever table/view he likes. Don't disable any<br />items.<br />2. If there are tables without a PK open a second modal dialog with an<br />explanation of the problem and offer to select a pk from a combobox.<br /><br />-------------<br /><br />3. Optional: Add a button "search suitable pk" which looks for a<br />suitable unique column.<br />4. Optional: Add a selection "read-only" to the combobox and do some<br />row_number() or other black magic and warn the user with a big red<br />dialog that he's about to do something very dangerous, unreliable and<br />that his warranty is now very void.<br /><br />Best,<br />Matthias<br /><br />On 09/01/2015 05:36 PM, Andreas Neumann wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex
0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Hi,<br /><br /> I would regard the loading of layers from a database something<br /> "relatively advanced". Normally I prepare ready to use QGIS project to<br /> my users who edit and query our GIS data where they don't have to<br /> bother with loading layers.<br /><br /> But you are correct that it can be different persons - the one who<br /> creates the view and the ones who are loading them.<br /><br /> You are welcome to improve the situation/GUI, but please don't go back<br /> to the old behavior where it is an assumption that the first column in<br /> the list is always the primary key.<br /><br /> Andreas<br /><br /> On 01.09.2015 14:51, James Keener wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> Why are you assuming the user who created the view is the one using<br /> QGIS?<br /><br /> Jim<br /><br /> On 09/01/2015 08:50 AM, Andreas
Neumann wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"> Hi,<br /><br /> I agree with Jürgen - better let the user choose the pkey column. If<br /> the<br /> user knows how to create a Postgis View he also knows how to select a<br /> primary key column.<br /><br /> Andreas<br /><br /> On 01.09.2015 14:37, Jürgen E. Fischer wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; 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 #e9b96e; padding-left: 1ex;"> I agree with Luca this should have been better not backported to<br /> 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> We intend to only backport fixes
and not bugs. ;)<br /><br /> You were always supposed to select the key column - preselecting<br /> the first<br /> column was the bug (also debatable).  And #11317 is a ticket that<br /> demonstrates<br /> there were unaware users.<br /><br /> That the first column often happens to be the primary key and and<br /> the combobox<br /> is not lexically sorted is somewhat pure luck - and unless you<br /> avoid having the<br /> key verified (using "use estimated metadata"), keeping a wrongly<br /> select<br /> column will make the layer to insert invalid.<br /><br /> But I agree that the tooltip that you get on disabled lines (not<br /> only for the<br /> key selection, but also geometry type and srid) might not be<br /> visible enough<br /> (but that IMHO would be just a GUI enhancement).<br /><br /><br /> Jürgen<br /><br /><br /><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><br /><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></blockquote><br /></blockquote><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><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 /></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>