Bug report #6284

featureCount() in QgsPostgresProvider: wrong value cached

Added by Matthias Kuhn almost 11 years ago. Updated about 10 years ago.

Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:15584


When calling featureCount() on a QgsPostgresProvider, the value returned is much smaller, than the actual value. This happens due to caching, if you uncomment the first two lines in gsPostgresProvider::featureCount() it will run an SQL query that returns the featureCount() correctly.

I don't know if this is a problem with every Postgres table, here I have a view and I'm using featureCount() from a python-script for a layer loaded with the project.

The real value is 17200, the cached value 172, so it's exactly a factor 100.


#1 Updated by Paolo Cavallini almost 11 years ago

  • Target version set to Version 2.0.0

#2 Updated by Matthias Kuhn about 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF