https://issues.qgis.org/https://issues.qgis.org/favicon.ico2019-05-20T16:14:32ZQGIS Issue TrackingQGIS Application - Bug report #22035: "Export to PostgreSQL" python error if rather schema has an uppercase letter in its namehttps://issues.qgis.org/issues/22035?journal_id=1047122019-05-20T16:14:32ZAlessandro Pasotti
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Assignee</strong> set to <i>Alessandro Pasotti</i></li></ul><p>Does it change anything if LOWERCASE_NAMES=False?</p> QGIS Application - Bug report #22035: "Export to PostgreSQL" python error if rather schema has an uppercase letter in its namehttps://issues.qgis.org/issues/22035?journal_id=1047362019-05-21T09:07:08ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Open</i></li></ul><p>Alessandro Pasotti wrote:</p>
<blockquote>
<p>Does it change anything if LOWERCASE_NAMES=False?</p>
</blockquote>
<p>seems is gives the same error:</p>
<p>QGIS version: 3.7.0-Master<br />QGIS code revision: 943c7d5<br />Qt version: 5.9.5<br />GDAL version: 2.2.3<br />GEOS version: 3.6.2-CAPI-1.10.2 4d2925d6<br />PROJ version: 493<br />Processing algorithm…<br />Algorithm 'Export to PostgreSQL' starting…<br />Input parameters:
{ 'CREATEINDEX' : True, 'DATABASE' : 'locale', 'DROP_STRING_LENGTH' : False, 'ENCODING' : 'UTF-8', 'FORCE_SINGLEPART' : False, 'GEOMETRY_COLUMN' : 'geom', 'INPUT' : '/media/giovanni/DATA/training/data/portugal_3763/localidades.shp', 'LOWERCASE_NAMES' : False, 'OVERWRITE' : True, 'PRIMARY_KEY' : None, 'SCHEMA' : 'Teste1', 'TABLENAME' : '' }</p>
<p>Traceback (most recent call last):<br />File "/usr/share/qgis/python/plugins/processing/tools/postgis.py", line 826, in _exec_sql<br />cursor.execute(sql)<br />psycopg2.ProgrammingError: schema "teste1" does not exist</p>
<p>During handling of the above exception, another exception occurred:</p>
<p>Traceback (most recent call last):<br />File "/usr/share/qgis/python/plugins/processing/tools/postgis.py", line 838, in _exec_sql_and_commit<br />self._exec_sql(c, sql)<br />File "/usr/share/qgis/python/plugins/processing/tools/postgis.py", line 829, in _exec_sql<br />e.cursor.query.decode(e.cursor.connection.encoding))<br />_core.QgsProcessingException: schema "teste1" does not exist<br />QUERY: CREATE INDEX sidx_localidades_geom ON Teste1.localidades USING <abbr title="geom">GIST</abbr></p>
<p>During handling of the above exception, another exception occurred:</p>
<p>Traceback (most recent call last):<br />File "/usr/share/qgis/python/plugins/processing/algs/qgis/ImportIntoPostGIS.py", line 204, in processAlgorithm<br />db.create_spatial_index(table, schema, geomColumn)<br />File "/usr/share/qgis/python/plugins/processing/tools/postgis.py", line 727, in create_spatial_index<br />self._exec_sql_and_commit(sql)<br />File "/usr/share/qgis/python/plugins/processing/tools/postgis.py", line 840, in _exec_sql_and_commit<br />except DbError:<br />NameError: name 'DbError' is not defined</p>
<p>Execution failed after 1.04 seconds</p>
<p>Loading resulting layers<br />Algorithm 'Export to PostgreSQL' finished</p> QGIS Application - Bug report #22035: "Export to PostgreSQL" python error if rather schema has an uppercase letter in its namehttps://issues.qgis.org/issues/22035?journal_id=1047712019-05-22T16:34:55ZAlessandro Pasotti
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>In Progress</i></li><li><strong>Resolution</strong> set to <i>fixed/implemented</i></li><li><strong>Pull Request or Patch supplied</strong> changed from <i>No</i> to <i>Yes</i></li></ul><p>PR <a class="external" href="https://github.com/qgis/QGIS/pull/10063">https://github.com/qgis/QGIS/pull/10063</a></p>
<p>That's just the tip of the iceberg, the code was written as if capital letters didn't exist.</p> QGIS Application - Bug report #22035: "Export to PostgreSQL" python error if rather schema has an uppercase letter in its namehttps://issues.qgis.org/issues/22035?journal_id=1048072019-05-23T07:58:09ZAlessandro Pasotti
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/ad24b876012ca91f92a8181ef4ff9c1e635fc230" title="Add missing error class and quote identifiers Fixes #22035 - case sensitive schema">qgis|ad24b876012ca91f92a8181ef4ff9c1e635fc230</a>.</p>