PostGIS  2.3.7dev-r@@SVN_REVISION@@
PG_FUNCTION_INFO_V1 ( LWGEOM_dimension  )

returns 0 for points, 1 for lines, 2 for polygons, 3 for volume.

returns max dimension for a collection.