Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS crashes with PostgreSQL views #29673

Closed
qgib opened this issue Apr 16, 2019 · 4 comments
Closed

QGIS crashes with PostgreSQL views #29673

qgib opened this issue Apr 16, 2019 · 4 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers Feedback Waiting on the submitter for answers High Priority Regression Something which used to work, but doesn't anymore

Comments

@qgib
Copy link
Contributor

qgib commented Apr 16, 2019

Author Name: Pietro Rossin (Pietro Rossin)
Original Redmine Issue: 21858
Affected QGIS version: 3.6.1
Redmine category:data_provider/postgis
Assignee: Alessandro Pasotti


Qgis 3.4.6 doesn't load a postgis view without an id and a geometry field (attributes only). DbManager says that the layer is invalid and cannot be loaded.

3.6.1-Noosa load the same view but crashes if I open the attribute table (crash report below).

The problem is solved if I add a counter column with

SELECT row_number() OVER () AS id,
....
...
from my_table

Pietro


Crash ID: 90077a9c9e70291cbc7f1009d8c0fddfd432457a

Stack Trace

QMutex::lock :
sourceSelectProviders :
QgsEnumerationWidgetFactory::fieldScore :
QgsEditorWidgetAutoConf::QgsEditorWidgetAutoConf :
QgsEditorWidgetAutoConf::editorWidgetSetup :
QgsEditorWidgetRegistry::findBest :
QgsAttributeTableModel::loadAttributes :
QgsAttributeTableModel::QgsAttributeTableModel :
QgsDualView::initModels :
QgsDualView::init :
QgsAttributeTableDialog::QgsAttributeTableDialog :
QgisApp::attributeTable :
QMetaObject::activate :
QAction::activate :
QMenu::actionGeometry :
QMenu::actionGeometry :
QMenu::mouseReleaseEvent :
QWidget::event :
QMenu::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QMenu::exec :
QgsLayerTreeView::contextMenuEvent :
QWidget::event :
QFrame::event :
QAbstractItemView::viewportEvent :
QCoreApplicationPrivate::sendThroughObjectEventFilters :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.6.1-Noosa
QGIS code revision: 2468226
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 2.4.1
Running against GDAL: 2.4.1

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.17134

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2019

Author Name: Giovanni Manghi (@gioman)


Pietro Rossin wrote:

Qgis 3.4.6 doesn't load a postgis view without an id and a geometry field (attributes only). DbManager says that the layer is invalid and cannot be loaded.

3.6.1-Noosa load the same view but crashes if I open the attribute table (crash report below).

The problem is solved if I add a counter column with

SELECT row_number() OVER () AS id,
....
...
from my_table

as far as I remember it was never possible to add a view without adding a column like you say

SELECT row_number() OVER () AS id

I confirm the crash on 3.6.1 also on Linux.
When adding such views in the layers panel the table gets the warning icon "unavailable layer".

In my case QGIS 3.6.1 crashes while try opening the table or properties of such table, but if the view contains also a geom column then QGIS crashes when trying to add the layer to the project.


  • operating_system was changed from Windows 10 pro x64 to
  • status_id was changed from Open to Feedback
  • subject was changed from 3.6.1-Noosa and qgis 3.4.6 problems with Postgis view without id and geom field to QGIS crashes with PostgreSQL view
  • regression was changed from 0 to 1
  • priority_id was changed from Normal to High

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2019

Author Name: Giovanni Manghi (@gioman)


  • subject was changed from QGIS crashes with PostgreSQL view to QGIS crashes with PostgreSQL views

@qgib
Copy link
Contributor Author

qgib commented May 23, 2019

Author Name: Alessandro Pasotti (@elpaso)


  • assigned_to_id was configured as Alessandro Pasotti

@qgib qgib added Feedback Waiting on the submitter for answers Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Data Provider Related to specific vector, raster or mesh data providers Crash/Data Corruption Regression Something which used to work, but doesn't anymore labels May 25, 2019
@elpaso elpaso self-assigned this May 27, 2019
@elpaso
Copy link
Contributor

elpaso commented May 30, 2019

I cannot reproduce this on master.

Closing because there is no way to get feedback now that almost all users are gone.

@elpaso elpaso closed this as completed May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers Feedback Waiting on the submitter for answers High Priority Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

2 participants