[QGIS-trac] [Quantum GIS] #1987: Layer with partial unique index
are wrong handeld
Quantum GIS
qgis at qgis.org
Fri Oct 9 08:41:42 EDT 2009
#1987: Layer with partial unique index are wrong handeld
---------------------------------------------------------+------------------
Reporter: cmoe | Owner: nobody
Type: bug | Status: new
Priority: critical: causes crash or data corruption | Milestone: Version 1.4.0
Component: Data Provider | Version: HEAD
Keywords: | Platform_version:
Platform: RedHat | Must_fix: Yes
Status_info: 0 |
---------------------------------------------------------+------------------
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.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1987>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list