[GIS] Is this correct behavior for ST_ConcaveHull (PostGIS)

postgis

I'm getting this error on the ST_ConcaveHull function call and after reading the docs, I'm unclear as to whether this Error is correct behavior or not.

Here is the business end of the query (vx are points):
select id , ST_ConcaveHull(ST_Collect(vx), 0.80)

And here's the error:

********** Error **********  
ERROR: ExteriorRing: geom is not a polygon  
SQL state: XX000  
Context: PL/pgSQL function st_concavehull(geometry,double precision,boolean) line 67 at assignment

Since I'm not passing polygons of any sort, I assume the ST_ConcaveHull function is creating them internally. I assume that there must be 1 or more grouping of points that don't produce an expected polygon. And this wouldn't surprise me, but I'd rather just get back a null geometry rather than an error that borks the query.

Is the behaviour as-designed, and if so, what is the best way to isolate the data that is causing the error (I assume I would need to pre-filter the data somehow)?

I can also tell you that
select id , ST_ConcaveHull(ST_Collect(vx), 0.99)
completes successfully.

PostGIS Version:

POSTGIS="2.0.4" GEOS="3.4.2-CAPI-1.8.2 r0" PROJ="Rel. 4.8.0, 6 March
2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.7.8"
LIBJSON="UNKNOWN" (core procs from "2.0.4" need upgrade) RASTER
(raster procs from "2.0.4" need upgrade)

Postgresql Version:

PostgreSQL 9.2.2, compiled by Visual C++ build 1600, 64-bit

Best Answer

Regina's comment actually answered the question--it isn't expected behaviour.

As a workaround, I wrapped the call with function w/ exception block so that I get null back (which is OK for my purposes).

Feel free to edit/improve because pl/pgsql isn't my strength:

 --DROP FUNCTION public.st_nullableconcavehull(geometry, double precision, boolean);

CREATE OR REPLACE FUNCTION public.st_nullableconcavehull(param_geom geometry, param_pctconvex double precision, param_allow_holes boolean DEFAULT false)
  RETURNS geometry AS
$BODY$
    DECLARE
    BEGIN       
            RETURN public.st_concavehull(param_geom,param_pctconvex,param_allow_holes);
        EXCEPTION when others then RETURN null;
    END;
$BODY$
  LANGUAGE plpgsql IMMUTABLE STRICT
  COST 100;
ALTER FUNCTION public.st_nullableconcavehull(geometry, double precision, boolean)
  OWNER TO postgres;
COMMENT ON FUNCTION public.st_nullableconcavehull(geometry, double precision, boolean) IS 'args: geomA, target_percent, allow_holes=false - The concave hull of a geometry represents a possibly concave geometry that encloses all geometries within the set. You can think of it as shrink wrapping.';