Bug report #13710

postgis view layer with compound key lost on project reload

Added by Jochen Huber about 9 years ago. Updated about 8 years ago.

Status:Closed
Priority:Normal
Assignee:Jürgen Fischer
Category:Data Provider/PostGIS
Affected QGIS version:master Regression?:No
Operating System:Windows (OSgeo4W) Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21737

Description

With QGIS 2.12, it is possible to load Postgis views with compound primary keys - a very useful feature. The Layers can be visualized and the attribute table is displayed correctly.
However, when loading a saved project file with such a layer, the layer is shown as defective and has to be manually added once again.
Postgis Layers for views with a single key field are loaded correctly.
An example project file with two sample layers is attached. Layer "test" (one pk field) loads correctly, layer "ViewGwStichtag" (two pk fields, both of type 'character varying') does not.

test.qgs - sample project file (server and db/user names anonymized) (23 KB) Jochen Huber, 2015-10-29 08:16 AM

Associated revisions

Revision daa65109
Added by Jürgen Fischer about 9 years ago

postgres provider: quote compound key columns in uri (fixes #13710)

Revision fa47c963
Added by Jürgen Fischer about 9 years ago

postgres provider: quote compound key columns in uri (fixes #13710)

(cherry picked from commit daa6510970e9afbc4d41d28e0c94b4f238eb372d)

History

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

  • Status changed from Open to Closed

#2 Updated by Sandro Santilli about 8 years ago

This change broke drag & drop copying of views from DBManager, see #15226

Also available in: Atom PDF