Correct bug from postgres comment using quote or caps

This commit is contained in:
Corentin.F 2020-02-27 23:36:58 +01:00 committed by GitHub
parent f2b2e96115
commit d87843c2c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -878,7 +878,7 @@ class PostGisDBConnector(DBConnector):
if comment is None:
self._execute(None, 'COMMENT ON TABLE "{0}"."{1}" IS NULL;'.format(schema, tablename))
else:
self._execute(None, 'COMMENT ON TABLE "{0}"."{1}" IS E\'{2}\';'.format(schema, tablename, comment))
self._execute(None, 'COMMENT ON TABLE "{0}"."{1}" IS $escape${2}$escape$;'.format(schema, tablename, comment))
def getComment(self, tablename, field):
"""Returns the comment for a field"""