#1338 closed bug (fixed)
nextval values of a postgis layer are not saved
Reported by: | cmoe | Owned by: | nobody |
---|---|---|---|
Priority: | critical: causes crash or data corruption | Milestone: | |
Component: | Data Provider | Version: | Trunk |
Keywords: | Postgis default values | Cc: | cedric.moeri@… |
Must Fix for Release: | Yes | Platform: | RedHat |
Platform Version: | Awaiting user input: | no |
Description
I'm trying to edit a postgis table (feature type point) like the following:
CREATE TABLE avt_oev_haltestellen ( ogc_fid integer NOT NULL DEFAULT nextval(('"avt_oev_haltestelle_ogc_fid_seq"'::text)::regclass), -- OGC Feature ID wkb_geometry geometry, -- OGC WKB Geometrie haltest_id integer NOT NULL DEFAULT nextval(('"avt_oev_haltest_id_seq"'::text)::regclass), anzahl_hs integer, new_date date DEFAULT ('now'::text)::date, archive_date date DEFAULT '9999-01-01'::date, archive integer DEFAULT 0, CONSTRAINT avt_oev_haltestellen_pkey PRIMARY KEY (ogc_fid), CONSTRAINT haltest_id_unique UNIQUE (haltest_id), CONSTRAINT "$1" CHECK (srid(wkb_geometry) = (-1)), CONSTRAINT "$2" CHECK (geometrytype(wkb_geometry) = 'POINT'::text OR wkb_geometry IS NULL) )
If I add a point the enter attribute values dialog pops up, with all the default values written in the fields. If I try to save it now, qgis/postgis answers that 'ERROR: null value in column "haltest_id" violates not-null constraint'. If I overwrite the nextval command/function of this fields with a number it works. Seems like the nextval only is working for the primary key. The other defaults in the example work.
Note:
See TracTickets
for help on using tickets.
fixed in r9450