Bug report #6142

problem with 'WITH' query in DB Manager to create new layer from query (using PostGIS DB)

Added by Remi Cura about 9 years ago. Updated about 9 years ago.

Assignee:Giuseppe Sucameli
Category:Data Provider
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:15470


When using DB Manager, and the SQL Windows,
When using a 'WITH' in a SQL query the result rows are properly shown and everything is fine.
But when trying to use this result to create a new layer it silently doesn't work.

I tried an equivalent SQL query without 'WITH' and it worked. I of course tried the 'WITH' query in PgAdmin it works well.

Declaration_Bug_QGis.png - A screenShot of QGIs and DB Manager showing the bug (302 KB) Remi Cura, 2012-08-02 03:07 AM

Associated revisions


#1 Updated by Giuseppe Sucameli about 9 years ago

  • OS version deleted (32 Vista)
  • Operating System deleted (Windows)
  • Target version deleted (Version 1.8.0)
  • Category changed from DB Manager to Data Provider

That behavior depends on the provider, there's a check that allows SELECT queries only.
Removing that check was discussed few weeks ago on the developer ML, see http://osgeo-org.1560.n6.nabble.com/Postgres-provider-checks-queries-and-refuses-CTE-td4987347.html

#2 Updated by Jürgen Fischer about 9 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF