Bug report #15449

Feature properties in attribute table sorted by text-cast, not numeric value

Added by Mike Taves over 7 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Unknown
Affected QGIS version:2.16.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:23375

Description

Using a simple PostGIS table:

SELECT *
INTO exampsort
FROM (
  SELECT generate_subscripts(ar, 1) AS id, unnest(ar) AS elem
  FROM (SELECT array[33.1, 0.9, 9.7]::float8[] ar) f
) f;
ALTER TABLE exampsort ADD PRIMARY KEY (id);

Add the table to QGIS 2.16.1 on Windows 7 x64 via OSGeo4W, and choose Open Attribute Table.

Clicking the "elem" header sorts the features. It is expected to sort the features based on their numeric values (e.g. 0.9, 9.7, 33.1), however the features are sorted on the text-cast values (e.g. 0.9, 33.1, 9.7).

History

#1 Updated by Harrissou Santanna over 7 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

already fixed in #15295

#2 Updated by Jürgen Fischer over 6 years ago

  • Category set to Unknown

Also available in: Atom PDF