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

Comments

@qgib
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

commented May 23, 2019

Author Name: Alessandro Pasotti (@elpaso)


  • assigned_to_id was configured as Alessandro Pasotti
@elpaso

This comment has been minimized.

Copy link
Contributor

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 May 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.