Bug report #11777

PostGIS: 0 is wrote instead of "null"

Added by Seb Radzimski almost 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Attribute table
Affected QGIS version:2.6.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:20005

Description

Hi.
While working with QGIS 2.6 and Postgres/Postgis 9.3/2.1 on Ubuntu (or 9.1/1.5 on Windows) I found a bug.
I have to explain that on a simple table like:

CREATE TABLE test ( gid serial NOT NULL, "int" integer, "real" real, "double" double precision, "text" text, the_geom geometry, CONSTRAINT test_pkey PRIMARY KEY (gid ) )

When I add first object (in QGIS) without any data (every attribute is null, except of gid) and I save it, all of them will be null in database. So far so good!
If I add a second object (without any data) and third one (with int=1, real=2 double=3) and save it, attributes of previus object (second one) will be 0 instead of null. If you would check attributes of second object before saving into database, QGIS show them as null. But while saving QGIS sends 0 instead of null to the database attributes of second object. It happens every time when attribute (integer, real, double) has been changed.
I belive I don't have to explain how big is the difference between 0 and null value ;) Because of that error it is impossible to use constraints in database to keep data in right order.
I have check that sytuation on QGIS 2.0/2.2 and there was no problem. It starts in 2.4...

Associated revisions

Revision 03713ce6
Added by Jürgen Fischer almost 10 years ago

postgres provider: fix adding features with null values (fixes #11777)

History

#1 Updated by Giovanni Manghi almost 10 years ago

  • Affected QGIS version changed from 2.6.0 to 2.6.1
  • OS version deleted (7,8 / 12.04)
  • Operating System deleted (Windows/Ubuntu)
  • Priority changed from Normal to Severe/Regression
  • Subject changed from 0 instead of null to PostGIS: 0 is wrote instead of "null"

confirmed here as a regression.

#2 Updated by Jürgen Fischer almost 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF