mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Addressing Issue #35767 to allow for view creation into specified schema from [ Create a view ] in DBManager
This commit is contained in:
parent
72b493b1d7
commit
70e9694a12
@ -1014,7 +1014,13 @@ class PostGisDBConnector(DBConnector):
|
||||
self._commit()
|
||||
|
||||
def createView(self, view, query):
|
||||
sql = "CREATE VIEW %s AS %s" % (self.quoteId(view), query)
|
||||
user_input = view
|
||||
|
||||
if '.' in user_input: # To allow view creation into specified schema
|
||||
schema, view_name = user_input.split('.')
|
||||
sql = "CREATE VIEW %s AS %s" % (self.quoteId([schema, view_name]), query)
|
||||
else: # No schema specified; uses public
|
||||
sql = "CREATE VIEW %s AS %s" % (self.quoteId(view), query)
|
||||
self._execute_and_commit(sql)
|
||||
|
||||
def createSpatialView(self, view, query):
|
||||
|
Loading…
x
Reference in New Issue
Block a user