New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QGIS inserts empty array into nullable array fields by default when creating new features in a PostGIS layer #38176
Comments
Happy to help with this one if needed, but not sure where would be a good place to start? I had a quick search through the src files for the source code for the new feature save dialog, but couldn't find anything. |
This is not an issue with the Postgres provider, but with the editor widget of an integer list that returns a 0-sized array, and not a NULL value |
@rouault is that something that could be changed without breaking other components? Or is this likely to be a larger change (the integer list editor widget sounds fairly fundamental)? Would this issue also affect non-integer (e.g. real/float) lists? |
Fixes qgis#38176 (cherry picked from commit 5c225cc)
Describe the bug
Given the following PostGIS table schema:
QGIS will insert an empty PostgreSQL array (i.e.
{}
) into thearray
field by default when creating new features whilst editing thetest
PostGIS layer. However, since thearray
field is nullable (i.e. it is not markedNOT NULL
), I would expect QGIS to enterNULL
into thearray
field by default (as this would be the default value if editing the table using other software).How to Reproduce
See above.
QGIS and OS versions
Additional context
The text was updated successfully, but these errors were encountered: