PostGIS – Fix ST_Union Function Extra Lines and Artifacts in PostGIS

postgis

I am trying to dissolve polygons based on a column type using PostGIS 10.4. I am pre-compiling tables, so time requirements are not really an issue. ST_Union does almost everything that I want straight out of the box. However, the ST_Union is has left lots of artifact lines inside the polygon as seen in the pictures below. Is anyone aware of a way to remove the lines inside the polygons? I am not sure if there is a better way to make the union call or rather to clean the polygons up after the union.

INSERT into new_table (count_field, geom)
SELECT count_comp, ST_Union(geom) as geom
FROM old_table
GROUP BY count_field;

enter image description here

Best Answer

After following advice from tThingumaBob and JohnPowellakaBarça, I was able to remove the slivers. ST_NumInteriorRings, ST_ExteriorRing, ST_DumpRings didn't work for me, but ST_Buffer() did.
Just for reference, if anyone else is working at the parcel level scale, the x value that ended up working for me was 0.00001. So my final query was INSERT into new_table (count_field, geom) SELECT count_field, ST_Buffer(ST_Union(ST_Buffer(geom, 0.00001)), -0.00001) as geom FROM old_table GROUP BY count_field;

Thanks for everyone's help