We are trying to combine the two Multipolygons that are stored in our PostGIS 2.1 database without losing the boundaries that are contained in each Multipolygon.
Our spatial data meets the following criteria.
ST_Intersects(higher_geom,lower_geom) = TRUE
ST_Crosses(higher_geom,lower_geom) = FALSE
ST_Within(higher_geom,lower_geom) = FALSE
If you then try to combine the columns lower_geom and higher_geom (both types of MultiPolygon) with the following query, the result of ST_Union does not have the boundaries of the original polygons.
SELECT
ST_Union(lower_geom, higher_geom)
FROM
myTable
To make this clearer, we added a screenshot. In our desired result, both green and red multipolygons should be contained in ONE new polygons still containing ALL borders.

Does anyone have an idea !?
Thanks in advance, Cord and Martin