Bug report #13856
DB Manager: SET DEFAULT syntax wrong
|Affected QGIS version:||3.0.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21879|
When setting the default for a column value, DB Manager fails to quote the value, e.g.
ALTER TABLE "pippo"."comuni" ALTER "nomemin" SET DEFAULT test123
ALTER TABLE "pippo"."comuni" ALTER "nomemin" SET DEFAULT 'test123'
therefore the command fails.
#3 Updated by Sebastian Dietrich over 4 years ago
Adding quotes always works, but is not always the correct solution. E.g. if I enter
currentuser the solution would be to correct the function name, not to add quotes. So the errormessage could be misleading.
Would a hint to the user when entering the default (e.g. a tooltip or a label) also suffice?
Note: This is an expression, string literals must be properly quoted.