Bug report #933

a string instead of a number in digitiser and table editor is not handled

Added by Maciej Sieczka - over 12 years ago. Updated about 11 years ago.

Status:Closed
Priority:Low
Assignee:Jürgen Fischer
Category:Vectors
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10992

Description

Digitising, PostGIS case:

1. Digitise a feature in PostGIS layer entering a string in a numeric column (human error). Press OK. QGIS accepts this. It shouldn't.

2. Digitise a few more, no errors. Say it took you half an hour. Toggle editing off, save changes. An error pops up:

ERROR:  invalid input syntax for integer: "the string you entered in error instead of number" 

You can't save changes. Beacause of one un-handled error all digitising has to be re-done.

Table editing, PostGIS case:

1. Add a PostGIS layer which has a numeric field.

2. In table editor "Start editing", enter a string instead of number in one row (human error). QGIS allows this - it shouldn't. Edit several other (correctly this time). Stop editing, save - error:

The [[PostgreSQL]] database returned: ERROR:  invalid input syntax for integer: "huha" 

When trying: UPDATE "public"."layer1" SET huha='huha' WHERE "gid"=

Again, you can't save changes. Beacause of one un-handled error editing has to be re-done.

Digitising, shapefile case:

1. Digitise a feature in a shapefile layer entering a string in a numeric column (human error). Press OK. QGIS accepts this. It shouldn't.

2. Digitise a few more, not making errors. Toggle editing off, save changes. Saved OK. Check the table - the row where you made an error is "0". This is not correct to silently force an arbitrary value when a string instead of number is given. The error should handled.

Editing table, shapefile case:

QGIS behaves the same like described above - forces an arbitrary value when a string instead of number is given, which is not right.

Associated revisions

Revision 3c94180b
Added by Jürgen Fischer over 12 years ago

use integer and double validators on attribute dialog and table, fixes #933

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision ae5d5ec5
Added by Jürgen Fischer over 12 years ago

use integer and double validators on attribute dialog and table, fixes #933

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Maciej Sieczka - over 12 years ago

After some recent Jurgen's fixes it is now possible to correct an invalid field that prevents comitting changes, during digitizing, in the table editor, in case of PostGIS layers. So it is not that bad now for PostGIS.

However, the silent data corruption in case of editing Shapefiles still takes place, as described above.

#2 Updated by Jürgen Fischer over 12 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in ae5d5ec5 (SVN r8357)

#3 Updated by Anonymous about 11 years ago

Milestone Version 0.9.2 deleted

Also available in: Atom PDF