mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-25 01:22:47 +00:00
ST_Estimated_Extent: make exception message about lack of stats clearer
git-svn-id: http://svn.osgeo.org/postgis/trunk@6773 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
4bb089e777
commit
3b7b8fc4a6
|
@ -1455,13 +1455,18 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS)
|
|||
elog(ERROR,"LWGEOM_estimated_extent: couldnt execute sql via SPI");
|
||||
PG_RETURN_NULL();
|
||||
}
|
||||
if (SPI_processed != 1)
|
||||
if (SPI_processed < 1)
|
||||
{
|
||||
SPI_finish();
|
||||
|
||||
POSTGIS_DEBUGF(3, " %d stat rows", SPI_processed);
|
||||
|
||||
elog(ERROR, "LWGEOM_estimated_extent: couldn't locate table within current schema");
|
||||
/*
|
||||
* Would be nice to be able to distinguish between
|
||||
* empty and missing analyze, as in the empty case
|
||||
* we'd have an informed estimate of an empty box...
|
||||
*/
|
||||
elog(ERROR, "LWGEOM_estimated_extent: no statistics for \"%s\".\"%s\".\"%s\" (empty table ? did you run ANALYZE ?)", nsp ? nsp : "(current_schema)", tbl, col);
|
||||
|
||||
PG_RETURN_NULL() ;
|
||||
}
|
||||
|
@ -1476,7 +1481,7 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS)
|
|||
|
||||
POSTGIS_DEBUG(3, " stats are NULL");
|
||||
|
||||
elog(ERROR, "LWGEOM_estimated_extent: couldn't locate statistics for table");
|
||||
elog(ERROR, "LWGEOM_estimated_extent: NULL statistics for \"%s\".\"%s\".\"%s\" (should not happen, consider filing a bug)", nsp ? nsp : "(current_schema)", tbl, col);
|
||||
|
||||
PG_RETURN_NULL();
|
||||
}
|
||||
|
@ -1512,4 +1517,4 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS)
|
|||
PG_RETURN_POINTER(box);
|
||||
}
|
||||
|
||||
#endif /* ! GSERIALIZED_ON */
|
||||
#endif /* ! GSERIALIZED_ON */
|
||||
|
|
Loading…
Reference in a new issue