I have a number of blocks that are lying next to each other in all directions.
So, the user can select individual and multiple blocks. There is a "must" requirement to select multiple blocks:
block have to touch each other by their walls, like this:
this is ok, but these are not okay,

because some blocks touch only by edges.
So, I have been using the st_numgeometries(st_union(geom)) and when it return 1 it is okay, otherwise not. However, for the selection (the user selected all blocks)

I am getting multi polygon which contains two polygons,
How should look like my query to get 1 (so they should be ok with this kind of selection)?


