Bug report #6284
featureCount() in QgsPostgresProvider: wrong value cached
|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.