When using postgis data, same functions are provided for all fields (numeric or not): count, first, last.
This is related to the use of QgsField.typename as typename is provided by the data provider and "Integer" or "Real" aren't values used by postgres.
Better use QgsField.type I think.
When using postgis data, same functions are provided for all fields (numeric or not): count, first, last. This is related to the use of QgsField.typename as typename is provided by the data provider and "Integer" or "Real" aren't values used by postgres. Better use QgsField.type I think.