I have a PostgreSQL database with a one-to-many relationship. Here is a reduced example:
CREATE TABLE buildings.building ( objectid serial NOT NULL, building_no character varying(40) NOT NULL, geometry geometry(Polygon,32638), CONSTRAINT building_pkey PRIMARY KEY (objectid) ) CREATE TABLE buildings.flat ( objectid serial NOT NULL, fk_property_group integer, fk_building integer NOT NULL, CONSTRAINT flat_pkey PRIMARY KEY (objectid), CONSTRAINT flat_fk_building_fkey FOREIGN KEY (fk_building) REFERENCES buildings.building (objectid) MATCH SIMPLE )
I defined a relationship in the QGIS (2.2 and 2.4) Project Properties and it looks good in the forms. But when I enter a new building I will have the value
nextval('real_estate.property_group_objectid_seq'::regclass) for the objectid of the building
and the flats that I want to add won't have the correct foreign key. Its actually NULL.
Is there any workaround/solution for this issue?