I have the same problem described here I am working with QGIS 2.18.10 and postgis 9.4.
Is there a way to make QGIS able to split the line and insert in the constrained field the expression "nextval('fogn_tronchi_cod_tronco_seq'::regclass)"?
My table is like this:
gid | integer | non null preimpostato nextval('fogn_tronchi_gid_seq'::regclass)
anno | numeric(10,0) |
codice_via | numeric(10,0) |
diametro | numeric(10,0) |
id_n1 | character varying(255) |
id_n2 | character varying(255) |
materiale | character varying(255) |
nome_via | character varying(255) |
note | character varying(255) |
pendenza | numeric |
pend_ind | numeric |
proprieta | character varying(255) |
qfondo_mon | numeric |
qfondo_val | numeric |
regime | character varying(255) |
stato_cons | character varying(255) |
tipologia | character varying(255) |
sollev_rec | character varying(255) |
recett_rec | character varying(255) |
comune | character varying(255) |
collaudo | character varying(255) |
accesso | character varying(255) |
prop_serv | character varying(255) |
gestito | character varying(4) |
criticita | character varying(255) |
the_geom | geometry |
cod_tronco | integer | non null preimpostato nextval('fogn_tronchi_cod_tronco_seq'::regclass)
Indici:
"fogn_tronchi_pkey" PRIMARY KEY, btree (gid)
"fogn_tronchi_cod_tronco_key" UNIQUE CONSTRAINT, btree (cod_tronco)
"fogn_tronchi_the_geom_gist" gist (the_geom)
Vincoli di controllo:
"enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2)
"enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 'MULTILINESTRING'::text OR the_geom IS NULL)
"enforce_srid_the_geom" CHECK (st_srid(the_geom) = 3003)