Open qgib opened 5 years ago
Author Name: Alessandro Pasotti (@elpaso)
How do you think QGIS would know if a NOT NULL column is filled by a trigger?
Do you have any solution in mind?
Author Name: Alessandro Pasotti (@elpaso)
Author Name: Tudor Bărăscu (@tudorbarascu)
From my perspective, it should all function like this:
Sounds good?
Thank you for taking a look Alessandro!
Author Name: Alessandro Pasotti (@elpaso)
That sounds reasonable to me, perhaps also issue a warning when the user unticks the checkbox: "The fields is marked NOT NULL but you are overriding this check, if you do not fill this field and there is nothing to set its value the operation will probably be rejected by the backend".
Changing to feature request (ok, I know it's debatable :)
Author Name: Tudor Bărăscu (@tudorbarascu)
Author Name: Nyall Dawson (@nyalldawson)
Author Name: Nyall Dawson (@nyalldawson)
Does this relate to #27895 ?
Author Name: Tudor Bărăscu (@tudorbarascu)
@Nyall Yes! IMHO It's ok that the forms get the constraints automatically but the settings of the constraints should override this.
Author Name: Tudor Bărăscu (@tudorbarascu)
A workaround would be to simply fill those specific columns with a default value, -1 let's say and it will let you pass while the database logic will change it to what's supposed to be.
Author Name: Hugo Mercier (@mhugo)
Author Name: Hugo Mercier (@mhugo)
Tudor, about your proposed workaround, I observed this is not even possible when the primary key has the default widget "Range". It seems the Range widget does not take the default value into account. However changing the widget type to "Text editor" allows to use a default value (and postgres is ok to receive a text for an integer)
Related issue #28650
Author Name: Hugo Mercier (@mhugo)
Author Name: Hugo Mercier (@mhugo)
Author Name: Jürgen Fischer (@jef-n)
Still valid on QGIS 3.22.3.
Author Name: Tudor Bărăscu (@tudorbarascu) Original Redmine Issue: 19671 Affected QGIS version: 3.5(master) Redmine category:forms
Some Postgres NOT NULL columns are filled automatically database side but the QGIS Dialog enforces filling of values. I found no way to disable this.
To recreate:
Related issue(s): #28650 (relates) Redmine related issue(s): 20831