I tried using dissolve and convex hull to do that, but they didn't work as intended. Also, this is just a fraction of the whole project, so I don't know how many clusters there should be. Hence, I can't run k-means.
Unfortunately, I don't know anything about PostGIS. Does anyone know how to do this?