Skip to content
Browse files

db manager: show database name in postgis connection details (fixes #…


(cherry picked from commit ecf3b37)
  • Loading branch information
jef-n committed Jun 26, 2016
1 parent ca86571 commit 4915d7671ce0b4a76ffed3de3cc5a95809bf10a1
@@ -125,8 +125,8 @@ def __init__(self, uri):


c = self._execute(None, u"SELECT current_user")
self.user = self._fetchone(c)
c = self._execute(None, u"SELECT current_user,current_database()")
self.user, self.dbname = self._fetchone(c)

@@ -22,10 +22,21 @@

from PyQt4.QtGui import QApplication

from ..info_model import TableInfo, VectorTableInfo, RasterTableInfo
from ..info_model import TableInfo, VectorTableInfo, RasterTableInfo, DatabaseInfo
from ..html_elems import HtmlSection, HtmlParagraph, HtmlTable, HtmlTableHeader, HtmlTableCol

class PGDatabaseInfo(DatabaseInfo):

def connectionDetails(self):
tbl = [
(QApplication.translate("DBManagerPlugin", "Host:"),,
(QApplication.translate("DBManagerPlugin", "User:"), self.db.connector.user),
(QApplication.translate("DBManagerPlugin", "Database:"), self.db.connector.dbname)
return HtmlTable(tbl)

class PGTableInfo(TableInfo):

def __init__(self, table):
@@ -111,6 +111,10 @@ def connectorsFactory(self, uri):
def dataTablesFactory(self, row, db, schema=None):
return PGTable(row, db, schema)

def info(self):
from .info_model import PGDatabaseInfo
return PGDatabaseInfo(self)

def vectorTablesFactory(self, row, db, schema=None):
return PGVectorTable(row, db, schema)

0 comments on commit 4915d76

Please sign in to comment.
You can’t perform that action at this time.