id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,must_fix,platform,platform_version,status_info 1876,PostgreSQL text fields become zero-length strings when blanked on attribute update edits from QGIS,mwtoews,jef,"This bug is simple to create in QGIS 1.0.x and 1.2.x. Edit any PostGIS layer with several text fields: 1. Add a geometry feature in QGIS, but leave some text fields blank when adding attributes; commit 1. View database record in another client app (e.g., PgAdminIII) to ensure that blank fields are NULL 1. Edit the feature attributes by adding text to a NULL field; 1. In QGIS, edit the feature attributes, but delete the text; commit The text field will now have a zero length text value {{{''}}} and not a NULL value. I have observed zero-length strings ""contaminating"" my database, and I can source these oddities to QGIS edits from when someone blanks out text from fields that previously had non-zero length text. Strictly speaking, this is not a bug, but is in a grey-area leaning toward ""feature"". Many client apps, like MS Access and pgAdminIII, consider zero-length strings to be NULLs. I prefer this behaviour, since it is consistent to the creation of the features in QGIS when no text has been added to some fields these were inserted as NULLs and not zero-length strings. As a suggested solution, borrow the behaviour from pgAdminIII, whereby an empty field is always interpreted as NULL, and a zero-length text string has the literal {{{''}}} (two consecutive single apostrophes). The zero-length literal should still be available for columns that are text but cannot be NULL.",bug,closed,major: does not work as expected,Version 1.2.0,Data Provider,Trunk,fixed,,,No,All,,0