Bug report #12346
PostGIS layer does not classify boolean for categorized style
|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|
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.
postgres provider: also cast field expressions to text (fixes #12346)
(cherry picked from commit 1acad42f48dcf7ce31512356c8dd609292f22899)