Bug report #1987
Layer with partial unique index are wrong handeld
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | nobody - | ||
Category: | Data Provider | ||
Affected QGIS version: | Regression?: | No | |
Operating System: | RedHat | Easy fix?: | No |
Pull Request or Patch supplied: | Resolution: | fixed | |
Crashes QGIS or corrupts data: | Copied to github as #: | 12047 |
Description
If you have a postgis point table with a partial unique index like
CREATE UNIQUE INDEX foo_bar_unique_idx ON foo USING btree (bar) WHERE archive = 0;
it looks like qgis isn't using the primary key of the table but the partial unique index. The index though isn't unique. It's only unique for the rows in the where condition.
The following problems I detected on such a table:
- the attribute table fails on sorting
- the identify tool sometimes marks a false point
- the select tool selects more as the expected points
- if you edit an affected point, the false point/row is edited
I only tested for a point layer. Maybe there is the same issue with lines and polygons.
Attached is a dump of a sample table with 3 points and a partial index that leads to the problems here. I may provide other/bigger sample data if necessary.
Associated revisions
fix #1987
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11784 c8812cc2-4d05-0410-92ff-de0c093fc19c
fix #1987
git-svn-id: http://svn.osgeo.org/qgis/trunk@11784 c8812cc2-4d05-0410-92ff-de0c093fc19c
History
#1 Updated by Jürgen Fischer about 15 years ago
- Resolution set to fixed
- Status changed from Open to Closed
fixed in 9037374d (SVN r11785)