Opened 15 years ago
Closed 15 years ago
#1933 closed bug (fixed)
Fix PostGIS dataprovider to check for unique data with SQL where clause
Reported by: | jpalmer | Owned by: | jef |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | |
Component: | Data Provider | Version: | Trunk |
Keywords: | postgis, postgresql | Cc: | |
Must Fix for Release: | No | Platform: | All |
Platform Version: | WinXP SP2 | Awaiting user input: | no |
Description
The method QgsPostgresProvider::uniqueData within qgspostgresprovider.cpp should be updated to use the SQL where cause for determining if the set primary key provides unique data.
i.e
if ( !sqlWhereClause.isEmpty() ) { sql += " where " + sqlWhereClause; }
Change History (4)
comment:1 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
follow-up: 4 comment:3 by , 15 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
The case I was wanting to implement already involves a view. It would be useful to use the where cause to show different spatial datasets based on this view.
How about modifying the QgsPostgresProvider::setSubsetString method to recheck for the unique primary key by calling the QgsPostgresProvider::uniqueData() method?
I would be really great to have this feature so I can build a python plug-in to dynamically add and view multiple vector layers based on a dataset identifier.
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
the where clause can be changed later, to the id needs to be unique even without the where clause. An alternative would be to create a view with the desired clause.