Skip to content

Commit

Permalink
Fix PG db-manager rename schema
Browse files Browse the repository at this point in the history
Fixes #38998
  • Loading branch information
elpaso committed Sep 24, 2020
1 parent e7e08fd commit 871f534
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,13 @@ def renameTable(self, table, new_table):
self.quoteString(new_table), self.quoteString(tablename), schema_where)
self._executeSql(sql)

def renameSchema(self, schema, new_schema):
try:
self.core_connection.renameSchema(schema, new_schema)
return True
except QgsProviderConnectionException:
return False

def commentTable(self, schema, tablename, comment=None):
if comment is None:
self._execute(None, 'COMMENT ON TABLE "{0}"."{1}" IS NULL;'.format(schema, tablename))
Expand Down

0 comments on commit 871f534

Please sign in to comment.