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

Creating a view in DB Manager causes python error and qgis must be killed #16979

Closed
qgib opened this issue Jun 24, 2013 · 4 comments
Closed

Creating a view in DB Manager causes python error and qgis must be killed #16979

qgib opened this issue Jun 24, 2013 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption DB Manager Relating to the DB Manager core plugin High Priority

Comments

@qgib
Copy link
Contributor

qgib commented Jun 24, 2013

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 8151
Affected QGIS version: master
Redmine category:db_manager


Apparently in DB Manager I can create a view like

@create VIEW test_view AS
SELECT a.gid AS gid, a.descricao, ST_Intersection(a.geom,b.geom)::geometry(LineString,3763) AS geom
FROM training.rede_ferroviaria a, training.evora b
WHERE ST_Intersects(a.geom, b.geom);@

without errors.

If the same query is done to create a table it would give

@geometry type (MultiLineString) does not match column type (LineString)
@

So... if afterwards I open the "table" or "preview" tab of the created view, DB Manager will give first

Traceback (most recent call last):
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\data_model.py", line 60, in data
    val = self.getData(index.row(), index.column())
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\data_model.py", line 116, in getData
    self.fetchMoreData(start)
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\postgis\\data_model.py", line 76, in fetchMoreData
    return self.fetchMoreData(row_start)
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\postgis\\data_model.py", line 78, in fetchMoreData
    self.resdata = self.cursor.fetchmany(self.fetchedCount)
DataError: Geometry type (MultiLineString) does not match column type (LineString)

and then

Traceback (most recent call last):
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\data_model.py", line 60, in data
    val = self.getData(index.row(), index.column())
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\data_model.py", line 116, in getData
    self.fetchMoreData(start)
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\postgis\\data_model.py", line 76, in fetchMoreData
    return self.fetchMoreData(row_start)
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\postgis\\data_model.py", line 70, in fetchMoreData
    self._createCursor()
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\postgis\\data_model.py", line 49, in _createCursor
    self.db._execute(self.cursor, sql)
  File "C:/OSGeo4W/apps/qgis-dev/./python/plugins\\db_manager\\db_plugins\\connector.py", line 84, in _execute
    raise DbError(e, sql)
DbError: Error:
current transaction is aborted, commands ignored until end of transaction block

over and over, and the only way out is to kill the program.


@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2013

Author Name: Daniel Vaz (Daniel Vaz)


Please, can you attach some dataset to reproduce the bug?

@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2013

Author Name: Giovanni Manghi (@gioman)


Daniel Vaz wrote:

Please, can you attach some dataset to reproduce the bug?

attached. Import both vectors in PostGIS then run the query is

@
CREATE VIEW test_view AS
SELECT a.gid AS gid, a.descricao, ST_Intersection(a.geom,b.geom)::geometry(LineString,3763) AS geom
FROM rede_ferroviaria a, evora b
WHERE ST_Intersects(a.geom, b.geom);@


  • 5998 was configured as tests_dbmanager.tar.gz

@qgib
Copy link
Contributor Author

qgib commented Jun 17, 2014

Author Name: Jürgen Fischer (@jef-n)


Not reproducable - the query fails, the "Database Error" window with the error message pops up, Table and Preview tabs are empty. Changing to an other layer and back doesn't reproduce the error, unless the tree is refreshed.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jun 17, 2014

Author Name: Giovanni Manghi (@gioman)


seems that in the meantime somehow the issue was fixed.


  • resolution was changed from to worksforme
  • status_id was changed from Feedback to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority DB Manager Relating to the DB Manager core plugin Crash/Data Corruption labels May 24, 2019
@qgib qgib closed this as completed May 24, 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 DB Manager Relating to the DB Manager core plugin High Priority
Projects
None yet
Development

No branches or pull requests

1 participant