diff --git a/NEWS.md b/NEWS.md index 4fa8226..bae78af 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ 0.24.0 (2018-XX-XX) * Travis: Test with PostgreSQL 9.5 and 10. +* _cdb_estimated_extent: Fix bug with ST_EstimatedExtent interaction. 0.23.2 (2018-07-19) * Fix `CDB_QueryTablesText` with parenthesized queries (#335) diff --git a/scripts-available/CDB_Overviews.sql b/scripts-available/CDB_Overviews.sql index 02d9fc0..3a32ce7 100644 --- a/scripts-available/CDB_Overviews.sql +++ b/scripts-available/CDB_Overviews.sql @@ -93,11 +93,8 @@ AS $$ table_id.schema_name, table_id.table_name, 'the_geom_webmercator' ); - BEGIN - EXECUTE ext_query INTO ext; - EXCEPTION - -- This is the typical ERROR: stats for "mytable" do not exist - WHEN internal_error THEN + EXECUTE ext_query INTO ext; + IF ext IS NULL THEN -- Get stats and execute again EXECUTE format('ANALYZE %1$s', reloid); @@ -107,7 +104,7 @@ AS $$ END IF; EXECUTE ext_query INTO ext; - END; + END IF; RETURN ext; END;