Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information