We have areas (merged polygons) with an unique id in a PostGIS database. The unique id (serial) is referenced by other datasets (actions that happen in these areas). Sometimes we need to append a few new polygons to the existing areas. When we try to merge them simply together, this doesn't work because the original area (with id) will be deleted to create a new one, but this isn't possible when the old area has actions that rely on the id. Is there no other possibility to append the new polygons to the old one without changing (deleting) the original id? Just like updating the geometry of the dataset.
Just to explain a bit further:
Usually we copy the NewPolygons fron another layer, merge them together on a temporary scratch layer => MergedPolygons and then add these to the layer with the ExistingPolygons.
We can then merge the MergegPolygons together with an ExistingPolygon. The goal is to add the geometry of the MergedPolygons to the one of the ExistingPolygon without using the merge function, since this function creates an NewPolygon and deletes the MergedPolygons and the ExistingPolygon. This doesn't work when the ExistingPolygon is already refered by other datasets that rely on it (1:n-relation).
So for us a Gui would be nice that would work the opposite way as the 'delete part of multipolygon'. Select ExistingPolygon + select MergedPolygons (on the same layer or on scratch layer) => Extend the geometry of the ExistingPolygon with the geometry of the selected MergedPolygon.
In Postgis this work:
With sq AS (SELECT the_geom FROM scratchLayer WHERE scratchLayer.id = SELECTED ID) -- I know that SELECTED ID doesn't exist in SQL UPDATE existingLayer SET the_geom = st_union(existingLayer.the_geom, sq.the_geom) FROM sq Where existingLayer.id = SELECTED ID -- I know that SELECTED ID doesn't exist in SQL