Skip to content
Browse files

[DbManager] allow to delete materialized views

(refs #13829)
  • Loading branch information
SebDieBln authored and brushtyler committed Jan 26, 2016
1 parent 9902613 commit 560007846a4577767cf1f78d2e99a3a737be3331
@@ -794,8 +794,8 @@ def createView(self, view, query):
def createSpatialView(self, view, query):
self.createView(view, query)

def deleteView(self, view):
sql = u"DROP VIEW %s" % self.quoteId(view)
def deleteView(self, view, isMaterialized=False):
sql = u"DROP %s VIEW %s" % ('MATERIALIZED' if isMaterialized else '', self.quoteId(view))

def renameView(self, view, new_name):
@@ -23,7 +23,7 @@
# this will disable the dbplugin if the connector raise an ImportError
from .connector import PostGisDBConnector

from PyQt4.QtCore import QSettings, Qt, QRegExp
from PyQt4.QtCore import QSettings, Qt, QRegExp, SIGNAL
from PyQt4.QtGui import QIcon, QAction, QApplication, QMessageBox
from qgis.gui import QgsMessageBar

@@ -227,6 +227,16 @@ def tableDataModel(self, parent):

return PGTableDataModel(self, parent)

def delete(self):
if self.isView:
ret = self.database().connector.deleteView((self.schemaName(),, self._relationType == 'm')
ret = self.database().connector.deleteTable((self.schemaName(),
if ret is not False:
return ret

class PGVectorTable(PGTable, VectorTable):

0 comments on commit 5600078

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