Bug report #14007

Updated by Giovanni Manghi over 4 years ago

In QGIS 2.12, having a Postgis table with Z component. It's not possible to add a new features, as it fails to save. Yet, It's possible to edit or copy/paste existing features.

The issue can be replicated by doing the following:

Creating a table in Postgis:



gid serial primary key,

name character varying(100),

geom geometry(MultiPolygonZ,4326)



Insert a record:

@INSERT INTO test (name,geom) VALUES

('polygon 1 single flat', ST_GeomFromText('MultiPolygonZ (((-30.0 42.0 0, -30.0 41.0 0, -29.0 41.0 0, -29.0 42.0 0, -30.0 42.0 0)))',4326));


Open the table in QGIS, start editing and create a new feature.

Trying to save the edits you will get the following error:

Could not commit changes to layer test

Errors: ERROR: 1 feature(s) not added.

Provider errors:

PostGIS error while adding features: ERRO: Column has Z dimension but geometry does not

If you copy paste the features to notepad, you notice that the geometry of the created feature lacks the Z component.

Also, it's impossible to edit the Z component with the new node editor.

This was already happening in QGIS 2.8.