https://issues.qgis.org/https://issues.qgis.org/favicon.ico2018-09-25T20:59:39ZQGIS Issue TrackingQGIS Application - Bug report #19946: ogr based tools do not work anymore with PostGIS inputs (possibly also other rdbms datasources)https://issues.qgis.org/issues/19946?journal_id=934872018-09-25T20:59:39ZNyall Dawson
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>In Progress</i></li><li><strong>Assignee</strong> set to <i>Nyall Dawson</i></li></ul> QGIS Application - Bug report #19946: ogr based tools do not work anymore with PostGIS inputs (possibly also other rdbms datasources)https://issues.qgis.org/issues/19946?journal_id=934922018-09-26T00:13:16ZNyall Dawson
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Feedback</i></li></ul><p>Can you confirm that the error is the missing "PG:" part before "dbname='teste' host=localhost port=543..."? E.g. ' PG:"dbname='teste' host=localhost port=5432......" '</p> QGIS Application - Bug report #19946: ogr based tools do not work anymore with PostGIS inputs (possibly also other rdbms datasources)https://issues.qgis.org/issues/19946?journal_id=935042018-09-26T09:44:08ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>Nyall Dawson wrote:</p>
<blockquote>
<p>Can you confirm that the error is the missing "PG:" part before "dbname='teste' host=localhost port=543..."? E.g. ' PG:"dbname='teste' host=localhost port=5432......" '</p>
</blockquote>
<p>there seems to be more stuff to be wrong in the created command, I'm having a look at it.</p> QGIS Application - Bug report #19946: ogr based tools do not work anymore with PostGIS inputs (possibly also other rdbms datasources)https://issues.qgis.org/issues/19946?journal_id=935642018-09-27T06:44:31ZJürgen Fischerjef@norbit.de
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-5 priority- closed" href="/issues/19938">Bug report #19938</a>: GDAL/OGR vector geoprocessing algorithms not working with GPKG, SQLite, FileGDB, etc inputs</i> added</li></ul> QGIS Application - Bug report #19946: ogr based tools do not work anymore with PostGIS inputs (possibly also other rdbms datasources)https://issues.qgis.org/issues/19946?journal_id=935822018-09-27T09:43:34ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>Nyall Dawson wrote:</p>
<blockquote>
<p>Can you confirm that the error is the missing "PG:" part before "dbname='teste' host=localhost port=543..."? E.g. ' PG:"dbname='teste' host=localhost port=5432......" '</p>
</blockquote>
<p>so there are a number of parameters in the call created by QGIS that are not supposed to be there, not at least the way they were implemented in QGIS3. I can't find any reference of the following in ogr2ogr docs as also in the ogr/postgres page:</p>
<p>sql=<br />(geom)<br />sslmode= <br />key= <br />srid= <br />type= <br />checkPrimaryKeyUnicity=<br />table=</p>
<p>A call that works here would be (referring to the "dissolve" tool):</p>
<p>ogr2ogr OUTPUT.shp PG:"dbname='teste' host='localhost' port=5432 user='teste' password='teste'" "lixo1"."tm_world_borders" -dialect sqlite -sql "SELECT ST_Union(geom) AS geom, region FROM '"lixo1"."tm_world_borders"' GROUP BY region" -f "ESRI Shapefile"</p>
<p>note that for ogr based geoprocessing operations using SQL (with SQLITE dialect, as internal ogr SQL is more limited) the schema/table names in the FROM clause must be around single quotes, otherwise it won't work.</p> QGIS Application - Bug report #19946: ogr based tools do not work anymore with PostGIS inputs (possibly also other rdbms datasources)https://issues.qgis.org/issues/19946?journal_id=936172018-09-28T03:36:13ZNyall Dawson
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/7977450796903babff4791301e64ecf52f52b039" title="[processing][ogr] Fix conversion of non-disk based layer sources to GDAL commands Fixes #19946">qgis|7977450796903babff4791301e64ecf52f52b039</a>.</p>