Bug report #19424
Not possible to add views from Add Layer window
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | - | ||
Category: | GUI | ||
Affected QGIS version: | 3.3(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 #: | 27252 |
Description
- Browser Panel
- DB Manager
But, it is not possible to add them from Add Layer window. IMO, for the sake of consistency it should be possible to add views from there too.
Thanks
Saber
Associated revisions
[postgres] Fix addition of views from Data Source Manager (fixes #19424)
In order to add a PostgreSQL layer based on a view, one needs to explicitly
pick one or more columns to serve as the primary key. However in both browser
dock and in the DB manager user can add a view as a layer without specifying
primary key. Users get confused about this behavior, therefore this commit
makes the Data Source Manager behave consistently with browser and DB manager,
that is it will pick the first column as the proposed primary key automatically.
While this may be a bit risky in letting user use wrong pkey, it is very
convenient (and consistent with other part of QGIS). Also, usability of selection
of geometry type / srid / pkey column(s) is not great so it is good not to force
people to always choose pkey for their views. The list will still keep
the warning icon and tooltip shown as before.
History
#1 Updated by Martin Dobias about 6 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|c225f56026bf12c6068ad8a6b087e4194b3e8fc8.