Bug report #21353

Query from DB Manager SQL window no longer loads as new layer

Added by José de Paula Rodrigues Neto Assis about 1 year ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assignee:Alessandro Pasotti
Category:DB Manager
Affected QGIS version:3.5(master) Regression?:Yes
Operating System:Linux (Debian Sid, x86-64) Easy fix?:Yes
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:29171

Description

I've just installed qgis-3.6.0 from sources, built Debian packages (current Debian Sid) and installed them. I opened one of my projects, which uses layers from PostGIS. I issued an SQL query from the SQL Window of DB Manager that returns some lines with geometry columns; so far, so good. I then check the "Load as new layer" box, select the primary key field, choose the correct geometry column and click the "Load" button. Nothing happens. I've uninstalled this 3.6.0 qgis, installed my previous 3.4.4, and the same actions produce a new layer on my project called QueryLayer.


Related issues

Duplicated by QGIS Application - Bug report #21410: Load as new layer from DB Manager does not load into QGIS Closed 2019-02-27
Duplicated by QGIS Application - Bug report #21434: Create SQL-Layer from DB-Manager Closed 2019-03-01

Associated revisions

Revision 74aa8ca1
Added by Alessandro Pasotti about 1 year ago

Fix db manager sql query

Fixes #21353

Revision 5520a01e
Added by Alessandro Pasotti about 1 year ago

Fix db manager sql query

Fixes #21353

Revision 0eeedacf
Added by Alessandro Pasotti about 1 year ago

Fix db manager sql query

Fixes #21353

History

#1 Updated by José de Paula Rodrigues Neto Assis about 1 year ago

Forgot to say that I've started with a clean state in both cases (i.e., I've deleted my .local/share/QGIS before starting up either version to confirm the bug).

The following simple SQL query (requires PostGIS) shows the bug:

select 1 as id, st_geomfromtext('POINT(-47.8669271 -15.7992462)', 4326) as geom;

This result in a layer with a single point in QGIS-3.4.4, and nothing with QGIS-3.6.0.

#2 Updated by Alessandro Pasotti about 1 year ago

  • Assignee set to Alessandro Pasotti

#3 Updated by Alessandro Pasotti about 1 year ago

  • Easy fix? changed from No to Yes
  • Resolution set to fixed/implemented
  • Pull Request or Patch supplied changed from No to Yes
  • Status changed from Open to In Progress

#4 Updated by Alessandro Pasotti about 1 year ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

#5 Updated by Alessandro Pasotti about 1 year ago

  • Duplicated by Bug report #21410: Load as new layer from DB Manager does not load into QGIS added

#6 Updated by Alessandro Pasotti about 1 year ago

Also available in: Atom PDF