Feature request #16527
Handle absent primary keys for postgresql views in add postgis layer dialog
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||24433|
When adding data from postgresql (materialized) view QGIS add layer dialog always shows exclamation mark icon due to missing primary key. But there is no way to set PK on a view in postgres. Can UI be tweaked a bit for this case?
#4 Updated by Nikolay Lebedev over 6 years ago
I have a column with unique values in my views, I just don't like to set it every time I need to add a view as a layer. Maybe there can be a convention of using "default" names for PK columns - like "id" or "gid"? Maybe postgresql comments can be utilized? Like setting a keyword in a comment. So QGIS should automatically "guess" the PK column.
So I definitely didn't miss a column in the Connection dialog:) I just want to avoid going into it and setting the same column name as a PK every time I want to add something to my QGIS project:))