How to use a PostGIS sequence in QGIS editing session?

المشرف العام

Administrator
طاقم الإدارة
I can't seem to get the sequence on my PostGIS table to increment to NEXTVAL in a QGIS editing session.

My PostGIS table is defined as:

CREATE TABLE qgis_topology_editing_test( geom geometry(MultiPolygon,2877), objectid serial NOT NULL)The sequence is defined as:

CREATE SEQUENCE qgis_topology_editing_test_objectid_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 3 CACHE 1;ALTER TABLE qgis_topology_editing_test_objectid_seq OWNER TO postgres;(which gets created automatically when you create a table with a column of SERIAL data type)

And my OBJECTID column is defined as :

ALTER TABLE qgis_topology_editing_test ADD COLUMN objectid integer;ALTER TABLE qgis_topology_editing_test ALTER COLUMN objectid SET NOT NULL;ALTER TABLE qgis_topology_editing_test ALTER COLUMN objectid SET DEFAULT nextval('qgis_topology_editing_test_objectid_seq'::regclass);So all of that seems in proper order.

In a QGIS editing session after adding a feature, I get this dialogue:



Which again looks correct - but looking at the attribute table, no sequential values are being added to the OBJECTID field:



Any thoughts?



أكثر...
 
أعلى