Not sure why Qgis likes playing magic on me. But here is the context:
1, In Postgres database, I have a table with two columns: “class” and “client”, each referring to an enum that I created. Both columns DO NOT have default value (showing below):
Some example class value include “Equipment A”, “Water” etc. Example client values include “ClientA”, “ClientB” etc.
2, Then I connect to postgres in Q and load the layer into map. Below is its properties:
But when I either toggle this layer for editing, or edit its attribute table. ONLY client column automatically enables drop down. Class column fails to enable a drop down selection as it should be with enum data type.
3, Attempts and exploration:
I first updated a few values in class column into invalid values, and Q is giving me error. So the enum check is in place. I then went to layer property and enabled the enum widget type for class column manually, which is working fine, so at least Q is able to do so but not automatically when layer is added in from database.
I searched around and found a similar Q enum github issue. But as I was saying, I neither of those two columns have default values.
I played around with the enum values, since class enum does have uppercase letter and space. I changed class enum to all lower case, replace space with “_”. Still no use.
So how to let Q automatically enable enum drop down in this case for class column? Qgis version: 3.28.8-Firenze