Bug report #12346

PostGIS layer does not classify boolean for categorized style

Added by Mike Taves over 9 years ago. Updated over 9 years ago.

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

Description

A PostGIS layer cannot be properly classified according to a boolean column for the categorized style.

For example, consider the example table:

create table qgistest (id serial, geom geometry, enabled boolean);
insert into qgistest (geom, enabled) values ('POINT(1 2)', true);
insert into qgistest (geom, enabled) values ('POINT(3 4)', false);

Add the layer to QGIS, and in the Layer Properties, change the Style to "Categorized", change Column to "enabled", and click "Classify". The results show 1 symbol without Value or Legend.

The expected result is to have at least two symbols with `t` and `f` values, which is the result by saving this layer to a Shapefile and repeating the above steps.

This is possibly related to #12306 where it may have been fixed. I don't have a trunk version, so I cannot test to see if this issue is fixed.

Associated revisions

Revision f04c40c2
Added by Jürgen Fischer over 9 years ago

postgres provider: also cast field expressions to text (fixes #12346)

(cherry picked from commit 1acad42f48dcf7ce31512356c8dd609292f22899)

Revision 306a53b8
Added by Jürgen Fischer over 9 years ago

postgres provider: also cast field expressions to text (fixes #12346)

History

#1 Updated by Jürgen Fischer over 9 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF