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

Error in DB Manager reading toplogy.layer #18027

Closed
qgib opened this issue Jan 27, 2014 · 5 comments
Closed

Error in DB Manager reading toplogy.layer #18027

qgib opened this issue Jan 27, 2014 · 5 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin

Comments

@qgib
Copy link
Contributor

qgib commented Jan 27, 2014

Author Name: Paolo Cavallini (@pcav)
Original Redmine Issue: 9433
Affected QGIS version: 2.0.1
Redmine category:db_manager


Clicking on topology.layer of a postgis_topology DB consistently returns
an error. PostGIS 2.1.1. Tested on Debian unstable, on Windows, and on OSX.

Errore durante l'esecuzione di codice Python:

Traceback (most recent call last):
  File "/usr/share/qgis/python/plugins/db_manager/db_manager.py", line
83, in itemChanged
    self.refreshTabs()
  File "/usr/share/qgis/python/plugins/db_manager/db_manager.py", line
134, in refreshTabs
    self.info.showInfo( item )
  File "/usr/share/qgis/python/plugins/db_manager/info_viewer.py", line
75, in showInfo
    self._showTableInfo(item)
  File "/usr/share/qgis/python/plugins/db_manager/info_viewer.py", line
132, in _showTableInfo
    html += table.info().toHtml()
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/info_model.py",
line 352, in toHtml
    ret = self.getTableInfo()
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/postgis/info_model.py",
line 194, in getTableInfo
    ret = TableInfo.getTableInfo(self)
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/info_model.py",
line 285, in getTableInfo
    general_info = self.generalInfo()
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/postgis/info_model.py",
line 95, in generalInfo
    if len( filter(lambda fld: fld.primaryKey, self.table.fields()) )
File "/usr/share/qgis/python/plugins/db_manager/db_plugins/plugin.py",
line 613, in fields
    self._fields = map(lambda x: self.tableFieldsFactory(x, self), fields)
  File "/usr/share/qgis/python/plugins/db_manager/db_plugins/plugin.py",
line 613, in
    self._fields = map(lambda x: self.tableFieldsFactory(x, self), fields)
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/postgis/plugin.py", line
229, in tableFieldsFactory
    return PGTableField(row, table)
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/postgis/plugin.py", line
311, in __init__
    for con in self.table().constraints():
  File "/usr/share/qgis/python/plugins/db_manager/db_plugins/plugin.py",
line 660, in constraints
    self._constraints = map(lambda x: self.tableConstraintsFactory(x,
self), constraints)
  File "/usr/share/qgis/python/plugins/db_manager/db_plugins/plugin.py",
line 660, in
    self._constraints = map(lambda x: self.tableConstraintsFactory(x,
self), constraints)
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/postgis/plugin.py", line
232, in tableConstraintsFactory
    return PGTableConstraint(row, table)
  File
"/usr/share/qgis/python/plugins/db_manager/db_plugins/postgis/plugin.py", line
334, in __init__
    self.foreignMatchType = TableConstraint.matchTypes[row[9]]
KeyError: u's'

Versione Python:
2.7.6 (default, Dec 30 2013, 14:39:47)
[GCC 4.8.2]


Versione di QGIS:
2.0.1-Dufour Dufour, 96dd172

@qgib
Copy link
Contributor Author

qgib commented Jan 27, 2014

Author Name: Sandro Santilli (@strk)


Does the user you connect as have permissions to read topology.layer ?

@qgib
Copy link
Contributor Author

qgib commented Jan 27, 2014

Author Name: Paolo Cavallini (@pcav)


Yes. However, a test revealed that in master the problem does not show off. As no backporting will be done, I think this can be closed.

@qgib
Copy link
Contributor Author

qgib commented Jan 27, 2014

Author Name: Sandro Santilli (@strk)


No backport ?

:'(

Any pointer to the fixing commit, in case anyone is willing to backport ?

@qgib
Copy link
Contributor Author

qgib commented Jan 27, 2014

Author Name: Paolo Cavallini (@pcav)


No idea, sorry - I just noticed that the error is gone when connecting from master

@qgib
Copy link
Contributor Author

qgib commented Jun 23, 2014

Author Name: Paolo Cavallini (@pcav)


  • resolution was changed from to fixed/implemented
  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin 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! DB Manager Relating to the DB Manager core plugin
Projects
None yet
Development

No branches or pull requests

1 participant