I had the same issue with the statistics. I followed the solution you provided for Henry. The deletion step was successful, but the insert command was not executed due to the following error:
sen4cap=# select * from reports.sp_insert_s1_statistics();
ERROR: lwgeom_intersection: GEOS Error: TopologyException: Input geom 1 is invalid: Self-intersection at or near point 3764870.0524828457 845413.34642566205 at 3764870.0524828457 845413.34642566205
CONTEXT: PL/pgSQL function reports.sp_get_s1_statistics(smallint) line 4 at RETURN QUERY
PL/pgSQL function reports.sp_insert_s1_statistics() line 4 at RETURN QUERY
Can you tell me what this means and how to solve it?