Skip to content

Commit

Permalink
Merge pull request #39000 from elpaso/bugfix-gh38998-db-manager-pg-re…
Browse files Browse the repository at this point in the history
…name-schema

Fix PG db-manager rename schema
  • Loading branch information
elpaso committed Sep 24, 2020
2 parents e7e08fd + 871f534 commit 5691357
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
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 5691357

Please sign in to comment.