title: ST_ConvexHull(ST_Collect(pointgeom)) returns points, linestrings and polygons
body: <p>I have a table full of point geometries that display normally in GIS clients. I want to group the points on an attribute (groupid) and create convex hulls around those. Seems straightforward, but getting an unexpected result: a 'geometry' field with mix of points, linestrings and polygons. I was expecting only polygons, and maybe for groups with a count of 1 to be ignored. Any ideas?</p>
  
  <p>The query:</p>
  
  <pre><code>SELECT groupid, ST_ConvexHull(ST_Collect(geom))) As hull_geom into hulledpoints
      FROM somepoints
      GROUP BY groupid;
  </code></pre>