With PostGIS, I need to perform the union of two polygon layers that have intersection areas and distinct areas while preserving all limits. I need to extract separated polygons for each intersected and distinct areas from both layers.
Using QGIS, the tool is called "Vector > Geoprocessing > Union"
here is a visual of the problem:
I need to do it with PostGIS. st_union seems to do a different job. Any idea?