Bug report #11067
field overflow when saving style
|Affected QGIS version:||2.4.0||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 #:||19401|
The layer style table has a field "f_table_name" which is char_varying(256). The idea is clearly to but the table name in here if the style applies to a postgis table. Fine. If the table is something more complicated (like a join) QGIS puts the SQL in the that field. If the text of the sql is over 256 characters the save fails with a misleading message about permission problems.
Firstly I suggest that the message be changed to something along the lines of "QGIS failed to insert this style in public.layer_style table. Most often this is a permission problem. See QGIS log for more details."
I would suggest that either QGIS does not save the sql in the name field or that it checks and truncates it if necessary.
Hmmm... I just changed the field type to text and it works fine now -- so that is another approach.
#1 Updated by Giovanni Manghi about 6 years ago
- Priority changed from Normal to Low
- Status changed from Open to Feedback
- Category set to Symbology
it seems to me that in the "f_table_name" is always place the name of the layer you are styling (no SQL), regardless if that layers have joins or not.
Can you provide an example?