-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgis Primary key #14758
Comments
Author Name: Luca Lanteri (Luca Lanteri) A possible solution may be to select the first integer valid primary key. User can also select a different field using the combobox. |
Author Name: Jürgen Fischer (@jef-n) mescal72 - wrote:
The primary key detection wasn't really reliable before. Being a primary key in the underlying table doesn't necessarily make the columns values unique in the view - and detecting which of the integer columns are unique can be quite expensive. What's the problem with having the user select the primary key?
|
Author Name: Giuseppe Sucameli (@brushtyler) Jürgen Fischer wrote:
It could be quite annoying... Why do not pre-select the combo with the first suitable field returned by the view? |
Author Name: Giuseppe Sucameli (@brushtyler) Furthermore in this moment the user cannot run the query builder before he defines what's the primary key to use for the view (because the view cannot be selected if no primary key is set). |
Author Name: Alessandro Ciali (Alessandro Ciali) I don't know if it is pertaining to this issue, but from version 1.9.90.23 the OID is no more recognised as primary key for the view. Is is a bug or a wanted change? |
Author Name: Giuseppe Sucameli (@brushtyler) The problem occurs again (regression?).
|
Author Name: Giuseppe Sucameli (@brushtyler) Blocker as policy for regressions.
|
Author Name: Giuseppe Sucameli (@brushtyler) The behavior was changed in 4945611 probably because if the the first suitable pkey is pre-selected the user doesn't notice the view has more pkeys. Even though the user doesn't select any pkey from the dropdown list a view with more suitable pkeys should be selectable. |
Author Name: Jürgen Fischer (@jef-n) Giuseppe Sucameli wrote:
The mandatory selection of a primary key is intentional. QGIS just lists all integer fields without caring if they are derived from some primary key or uniquely indexed table field anymore - because that doesn't tell you anything about their uniqueness in the view anyway. The user needs to decide - QGIS will just verify that the selected key is unique (unless "use estimated table metadata" is used). The valid bug was that @oid@ wasn't considered anymore - and that was fixed. 1.7 projects already have a @key@ field for views in their datasource uri and continue to work - so I don't consider this a regression.
|
Author Name: Luca Lanteri (Luca Lanteri) Ok, but the result is that now I must do a lot of clicks to load multiple views 'cause I have to select all single gid for every view. This is formally correct but from the user's point of view is a very annoying regression. |
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Jürgen Fischer (@jef-n) Fixed in changeset "8eb323af13c0d949e6711eac04f553ba2e0848a8".
|
Author Name: Luca Lanteri (Luca Lanteri)
Original Redmine Issue: 4969
Affected QGIS version: master
Redmine category:data_provider/postgis
Assignee: Jürgen Fischer
Hi,
with latest version of QGIS master (1.9.90.56) when I load a postGIS view select the primary key column from combobox is mandatory, whereas with previous version (surely back from 1.9.90.23), if a valid primary exists it was automatically recognized.
The text was updated successfully, but these errors were encountered: