Bug report #14715

QGIS Server sending sometimes UPDATE… WHERE NULL to postgis in a WFS-T if primary key of table is Numeric

Added by Aitor Gil over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:QGIS Server
Affected QGIS version:2.14.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:22675

Description

You can see the description of the problem and all the tests I have made during last months here:

http://gis.stackexchange.com/questions/178684/qgis-server-sending-update-where-null-to-postgis-in-a-wfs-layer

Finally, Matthias Kuhn, one of the developers of QGIS gave me the key to solve the problem.

The WHERE clause is built checking the type of the primary key of the table. It should be an Integer and in some of my tables I saw that the type was Numeric(8,0).

Those tables and primary keys were created by a third-party app some time ago.

I changed the type to Integer and all the tests I have made since then have worked (I have made more than 100 edition tests via WFS, enough in my opinion to conclude that the problem have been solved).

Conclusion: if the primary key of a postgis table is Numeric, the where clause of the WFS-T UPDATE query to Postgis is sometimes null (Where Null) and therefore, nothing is updated.


Related issues

Duplicates QGIS Application - Bug report #14196: QGIS Server sending UPDATE... WHERE NULL to postgis in a ... Closed 2016-01-29

History

#1 Updated by Jürgen Fischer over 8 years ago

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

Also available in: Atom PDF