Bug report #6142

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

Added by Remi Cura over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:Normal
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

Description

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

History

#1 Updated by Giuseppe Sucameli over 10 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 over 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF