Ticket is #2050
git-svn-id: http://svn.osgeo.org/postgis/trunk@10455
b70326c6-7e19-0410-871a-
916f4a2858ee
BEGIN
EXECUTE sql INTO attr;
EXCEPTION WHEN OTHERS THEN
- RAISE NOTICE 'Unable to get the extent of a sample raster';
- RETURN FALSE;
+ RAISE NOTICE 'Unable to get the extent of a sample raster. Attempting memory efficient (slower) approach';
+
+ sql := 'SELECT st_ashexewkb(st_convexhull(st_memunion(st_convexhull('
+ || quote_ident($3)
+ || ')))) FROM '
+ || fqtn;
+ BEGIN
+ EXECUTE sql INTO attr;
+ EXCEPTION WHEN OTHERS THEN
+ RAISE NOTICE 'Still unable to get the extent of a sample raster. Cannot add extent constraint';
+ RETURN FALSE;
+ END;
END;
sql := 'ALTER TABLE ' || fqtn