Skip to main content

I think you're looking for this:

CREATE TABLE tableC AS 
  (SELECT ST_Intersection(a.geom, b.geom) AS geom, a.name AS name 
   FROM tableA AS a, tableB AS b
   WHERE ST_Intersects(a.geom, b.geom));

By looking at each intersection separately, you can access all the included data.

lynxlynxlynx
  • 4.3k
  • 3
  • 31
  • 46