Bug report #21469

Error when adding query results via DB Manager

Added by Topi Tjukanov almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:DB Manager
Affected QGIS version:3.4.5 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:29286

Description

When trying to add a new layer from PostGIS query results via DB Manager (Load as new layer) the layer doesn't get added, but instead I get the following error:

An error has occurred while executing Python code: 

AttributeError: 'DlgSqlWindow' object has no attribute '_getSqlExecutableQuery' 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python/plugins\db_manager\dlg_sql_window.py", line 434, in loadSqlLayer
    layer = self._getSqlLayer(self.filter)
  File "C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python/plugins\db_manager\dlg_sql_window.py", line 396, in _getSqlLayer
    query = self._getSqlExecutableQuery()
AttributeError: 'DlgSqlWindow' object has no attribute '_getSqlExecutableQuery'

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.6.0-Noosa Noosa, 58734527ab 

Python Path:
C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python
C:/Users/T T/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/T T/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.6\bin\python37.zip
C:\PROGRA~1\QGIS3~1.6\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib
C:\Program Files\QGIS 3.6\bin
C:\PROGRA~1\QGIS3~1.6\apps\Python37
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.6\apps\Python37\lib\site-packages\Pythonwin
C:/Users/T T/AppData/Roaming/QGIS/QGIS3\profiles\default/python

Error is in both 3.6 Nooa and 3.4.5 LTR


Related issues

Duplicated by QGIS Application - Bug report #21554: query as view works in 2.14 LTR and does not in 3.4.5 LTR Closed 2019-03-11

History

#1 Updated by Giovanni Manghi almost 6 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

Already fixed and backported, wait for the new builds/point releases.

#2 Updated by Alessandro Pasotti almost 6 years ago

  • Duplicated by Bug report #21554: query as view works in 2.14 LTR and does not in 3.4.5 LTR added

Also available in: Atom PDF