Fix PG db-manager rename schema

Fixes #38998
This commit is contained in:
Alessandro Pasotti 2020-09-24 14:23:26 +02:00
parent e7e08fd504
commit 871f534ef9

View File

@ -901,6 +901,13 @@ class PostGisDBConnector(DBConnector):
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))