finish kmeans in postgrsql