Skip to content
Permalink
Browse files

Add missing error class and quote identifiers

Fixes #22035 - case sensitive schema
  • Loading branch information
elpaso committed May 22, 2019
1 parent 5cd8cb6 commit ad24b876012ca91f92a8181ef4ff9c1e635fc230
Showing with 11 additions and 1 deletion.
  1. +11 −1 python/plugins/processing/tools/postgis.py
@@ -38,6 +38,16 @@
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)


class DbError(Exception):

def __init__(self, message, query=None):
self.message = str(message)
self.query = (str(query) if query is not None else None)

def __str__(self):
return 'MESSAGE: %s\nQUERY: %s' % (self.message, self.query)


def uri_from_name(conn_name):
settings = QgsSettings()
settings.beginGroup(u"/PostgreSQL/connections/%s" % conn_name)
@@ -862,7 +872,7 @@ def _table_name(self, schema, table):
if not schema:
return self._quote(table)
else:
return u'%s.%s' % (self._quote(schema), self._quote(table))
return u'"%s"."%s"' % (self._quote(schema), self._quote(table))


# For debugging / testing

0 comments on commit ad24b87

Please sign in to comment.
You can’t perform that action at this time.