https://issues.qgis.org/https://issues.qgis.org/favicon.ico2018-03-03T14:56:42ZQGIS Issue TrackingQGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=882462018-03-03T14:56:42ZArni Geirssonarni@alta.is
<ul><li><strong>Assignee</strong> deleted (<del><i>Arni Geirsson</i></del>)</li></ul> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=882472018-03-03T17:27:19ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Subject</strong> changed from <i>Update SQL layer </i> to <i>DB Manager: "Update SQL layer" error </i></li><li><strong>Description</strong> updated (<a href="/journals/diff/88247?detail_id=77107" title="View differences">diff</a>)</li><li><strong>Regression?</strong> changed from <i>No</i> to <i>Yes</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>High</i></li><li><strong>Operating System</strong> deleted (<del><i>Win 10</i></del>)</li></ul><p>updated subject and description</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=890752018-04-03T13:31:10ZDaniel Possenriedepossenriede@gmail.com
<ul></ul><p>I can confirm this error. QGIS 3.0.1 on Windows 10 connected to PostgreSQL 9.6 with Postgis 2.3. <br />The problem is that QGIS adds SELECT * FROM " ... " to the original query (... is the original query). It also duplicates all double quotes in the query.</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=904202018-06-19T10:25:34ZGer Groeneveldgergroeneveld@vision-energy-group.com
<ul></ul><p>Update goes wrong when the layer is in edit mode. Afterwards the edit is switched off and can't be enabled anymore.</p>
<p>Quick solution: Switch of edit mode and answer yes to "save changes", postgresql table does get updated (see db manager, table content).</p>
<p>(QGIS 3.0.3; Postgresql 10, Linux 4.15/Qt5/Ubuntu 18.04)</p>
<p>DON'T FORGET or else one has to restart QGIS again, log in, and copy all the settings for that layer again. Obvious the update SQL layer should switch of edit mode and re-enable again</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=925342018-09-04T13:24:54ZSamuel Wechslersamuel.wechsler@vogelwarte.ch
<ul></ul><p>I can confirm the error observed by Arni Geirsson. This only appeared with QGIS3 it was properly working in QGIS2.18. I'd be very glad if this could be fixed. Our institution switched from QGIS 2.18 to QGIS 3.2 and it is a bit a pain to explain to end users why things that used to work don't anymore.</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=925382018-09-04T14:09:22ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>Samuel Wechsler wrote:</p>
<blockquote>
<p>I can confirm the error observed by Arni Geirsson. This only appeared with QGIS3 it was properly working in QGIS2.18. I'd be very glad if this could be fixed. Our institution switched from QGIS 2.18 to QGIS 3.2 and it is a bit a pain to explain to end users why things that used to work don't anymore.</p>
</blockquote>
<p>if is a blocker for your organization please consider support the work needed to make the fix, or eventually submit a patch.</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=930872018-09-20T12:55:30ZJürgen Fischerjef@norbit.de
<ul><li><strong>Duplicated by</strong> <i><a class="issue tracker-1 status-5 priority-4 priority- closed" href="/issues/19843">Bug report #19843</a>: Update SQL Layer converts query to table name</i> added</li></ul> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=975602018-12-28T11:16:29ZPaolo Cavallinicavallini@faunalia.it
<ul></ul><p>Could you please check again on current release?<br />Thanks.</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=976002018-12-28T13:59:33ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul><p>Paolo Cavallini wrote:</p>
<blockquote>
<p>Could you please check again on current release?<br />Thanks.</p>
</blockquote>
<p>Please change status to "feedback" when needed.</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=976352018-12-29T13:09:05ZArni Geirssonarni@alta.is
<ul></ul><p>Giovanni Manghi wrote:</p>
<blockquote>
<p>Paolo Cavallini wrote:</p>
<blockquote>
<p>Could you please check again on current release?<br />Thanks.</p>
</blockquote>
<p>Please change status to "feedback" when needed.</p>
</blockquote>
<p>Hi<br />This seems to be resolved. I changed the query multiple times and it works as expected.<br />Thanks!</p>
<p>Arni</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=976362018-12-29T13:09:57ZArni Geirssonarni@alta.is
<ul></ul><p>Arni Geirsson wrote:</p>
<blockquote>
<p>Giovanni Manghi wrote:</p>
<blockquote>
<p>Paolo Cavallini wrote:</p>
<blockquote>
<p>Could you please check again on current release?<br />Thanks.</p>
</blockquote>
<p>Please change status to "feedback" when needed.</p>
</blockquote>
<p>Hi<br />This seems to be resolved. I changed the query multiple times and it works as expected.<br />Thanks!</p>
<p>Arni</p>
</blockquote>
<p>I forgot to add that I am using 3.4.3</p>
<p>Arni</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=976372018-12-29T13:38:00ZArni Geirssonarni@alta.is
<ul></ul><p>I notice the following and wonder if it is the intended way.<br />I create a query in DB Manager: select id, st_buffer(geom,10) as geom from kopavogur.byggingar where id<100<br />I load the result as a new layer using the id and geom and it works well.<br />Now I right-click the layer and select "Update SQL Layer..." and the query dialog opens again, but with the query modified, as follows:</p>
<p>(SELECT row_number() over () AS <em>uid</em>,* FROM (select id, st_buffer(geom,10) as geom from kopavogur.byggingar where id<100 ) AS <em>subq_1</em> )</p>
<p>I can modify this but must remember to check again the field labelled "Column(s) with unique values" as it now has the value "_uid_" but grayed out. The modification will not load until I have rechecked the check box.</p>
<p>Arni</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=976382018-12-29T13:43:33ZArni Geirssonarni@alta.is
<ul></ul><p>Another observation that had me confused for a while:<br />When modifying the query by putting st_buffer around the line geometry, obviously a polygon layer would result but the original layer continued to be listed in the layer list as a line layer and nothing was shown on the canvas. I suppose QGIS was unable to handle the fact that a layer that was originally a line layer had been transformed into a polygon layer by updating the query. Perhaps a warning of some sort could be issued.</p>
<p>Arni</p> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=976712018-12-31T13:48:52ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Resolution</strong> set to <i>fixed/implemented</i></li><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul> QGIS Application - Bug report #18244: DB Manager: "Update SQL layer" error https://issues.qgis.org/issues/18244?journal_id=977262019-01-02T08:05:47ZSamuel Wechslersamuel.wechsler@vogelwarte.ch
<ul></ul><p>I can also confirm the fix. Works as expected. Thanks guys!</p>