I have a table with geometries where some geometries overlaps with other geometries in the same table.
I already found an answer for this question here: Check whether table has overlapping polygons, in PostGIS?
But when I try to create a view of the query as result I do not get any geometries for the query only a table, this also helps a lot but with geometries it would help even more.
The query is
SELECT *
FROM schema.table1 a
INNER JOIN schema.table1 b ON
(a.geom && b.geom AND ST_Overlaps(a.geom, b.geom))
WHERE a.id != b.id;
With this query I get the table and if I substitute st_overlaps with st_intersection I get the query error that the intersection must be type boolean and not type geometry.
select *
byselect st_intersection(a.geom, b.geom)
(and eventually other fields from the tables)