SELECT DropGeometryColumn('','bug2367','geom');
DROP TABLE "bug2367";

BEGIN;
CREATE TABLE bug2367 (geom geometry);
--SELECT AddGeometryColumn('','bug2367','geom',4326,'POLYGON',2);
INSERT INTO bug2367 VALUES ('POLYGON((-104.856856991821 39.921141847083,-104.856856991821 40.0008197608011,-104.845931622255 40.0008197608011,-104.845931622255 39.921141847083,-104.856856991821 39.921141847083))');
CREATE INDEX "bug2367_geom_gist" ON bug2367 USING GIST("geom");
COMMIT;

ANALYZE bug2367;
-- this is what geoserver uses and is incorrect
SELECT ST_AsText(ST_force_2d(ST_Envelope(ST_Estimated_Extent('public', 'bug2367', 'geom'))));
-- this is bad, too
SELECT ST_Estimated_Extent('public','bug2367','geom');
-- this is correct
SELECT ST_Extent(geom) from bug2367;
