--- /dev/null
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+--
+-- $Id$
+--
+-- PostGIS - Spatial Types for PostgreSQL
+-- http://postgis.org/
+-- Copyright 2009 Paul Ramsey <pramsey@cleverelephant.ca>
+--
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+--
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+-- metadata table
+DROP VIEW geography_columns;
+
+-- indexes
+DROP OPERATOR CLASS gist_geography_ops USING gist CASCADE;
+DROP OPERATOR CLASS btree_geography_ops USING btree CASCADE;
+
+-- r-tree operator
+DROP OPERATOR && (geography,geography);
+
+-- b-tree operators
+DROP OPERATOR < (geography,geography);
+DROP OPERATOR <= (geography,geography);
+DROP OPERATOR = (geography,geography);
+DROP OPERATOR >= (geography,geography);
+DROP OPERATOR > (geography,geography);
+
+-- casts
+DROP CAST IF EXISTS (geography AS geometry);
+DROP CAST IF EXISTS (geography AS geography);
+DROP CAST IF EXISTS (geometry AS geography);
+
+--
+-- Text hacks to over-ride implicit casting issues with GEOMETRY
+-- TODO Remove for 2.0
+--
+DROP FUNCTION IF EXISTS ST_AsText(text);
+DROP FUNCTION IF EXISTS ST_AsBinary(text);
+DROP FUNCTION IF EXISTS ST_AsSVG(text);
+DROP FUNCTION IF EXISTS ST_AsGML(text);
+DROP FUNCTION IF EXISTS ST_AsKML(text);
+DROP FUNCTION IF EXISTS ST_AsGeoJson(text);
+DROP FUNCTION IF EXISTS ST_Distance(text, text);
+DROP FUNCTION IF EXISTS ST_DWithin(text, text, float8);
+DROP FUNCTION IF EXISTS ST_Area(text);
+DROP FUNCTION IF EXISTS ST_Length(text);
+DROP FUNCTION IF EXISTS ST_Covers(text, text);
+DROP FUNCTION IF EXISTS ST_CoveredBy(text, text);
+DROP FUNCTION IF EXISTS ST_Intersects(text, text);
+DROP FUNCTION IF EXISTS ST_Buffer(text, float8);
+DROP FUNCTION IF EXISTS ST_Intersection(text, text);
+
+-- functions
+DROP FUNCTION IF EXISTS ST_AsText(geography);
+DROP FUNCTION IF EXISTS ST_GeographyFromText(text);
+DROP FUNCTION IF EXISTS ST_AsBinary(geography);
+DROP FUNCTION IF EXISTS ST_GeographyFromBinary(bytea);
+DROP FUNCTION IF EXISTS geography_typmod_dims(integer);
+DROP FUNCTION IF EXISTS geography_typmod_srid(integer);
+DROP FUNCTION IF EXISTS geography_typmod_type(integer);
+DROP FUNCTION IF EXISTS geography(geometry);
+DROP FUNCTION IF EXISTS geometry(geography);
+
+DROP FUNCTION IF EXISTS geography_gist_consistent(internal,geometry,int4);
+DROP FUNCTION IF EXISTS geography_gist_compress(internal);
+DROP FUNCTION IF EXISTS geography_gist_penalty(internal,internal,internal);
+DROP FUNCTION IF EXISTS geography_gist_picksplit(internal, internal);
+DROP FUNCTION IF EXISTS geography_gist_union(bytea, internal);
+DROP FUNCTION IF EXISTS geography_gist_same(box2d, box2d, internal);
+DROP FUNCTION IF EXISTS geography_gist_decompress(internal);
+DROP FUNCTION IF EXISTS geography_gist_selectivity (internal, oid, internal, int4);
+DROP FUNCTION IF EXISTS geography_gist_join_selectivity(internal, oid, internal, smallint);
+DROP FUNCTION IF EXISTS geography_overlaps(geography, geography);
+
+DROP FUNCTION IF EXISTS geography_lt(geography, geography);
+DROP FUNCTION IF EXISTS geography_le(geography, geography);
+DROP FUNCTION IF EXISTS geography_gt(geography, geography);
+DROP FUNCTION IF EXISTS geography_ge(geography, geography);
+DROP FUNCTION IF EXISTS geography_eq(geography, geography);
+DROP FUNCTION IF EXISTS geography_cmp(geography, geography);
+
+DROP FUNCTION IF EXISTS ST_AsSVG(geography,int4,int4);
+DROP FUNCTION IF EXISTS ST_AsSVG(geography,int4);
+DROP FUNCTION IF EXISTS ST_AsSVG(geography);
+
+DROP FUNCTION IF EXISTS _ST_AsGML(int4, geography, int4, int4);
+DROP FUNCTION IF EXISTS ST_AsGML(geography, int4);
+DROP FUNCTION IF EXISTS ST_AsGML(geography);
+DROP FUNCTION IF EXISTS ST_AsGML(int4, geography);
+DROP FUNCTION IF EXISTS ST_AsGML(int4, geography, int4);
+DROP FUNCTION IF EXISTS ST_AsGML(geography, int4, int4);
+DROP FUNCTION IF EXISTS ST_AsGML(int4, geography, int4, int4);
+
+DROP FUNCTION IF EXISTS _ST_AsKML(int4, geography, int4);
+DROP FUNCTION IF EXISTS ST_AsKML(geography, int4);
+DROP FUNCTION IF EXISTS ST_AsKML(geography);
+DROP FUNCTION IF EXISTS ST_AsKML(int4, geography);
+DROP FUNCTION IF EXISTS ST_AsKML(int4, geography, int4);
+
+DROP FUNCTION IF EXISTS _ST_AsGeoJson(int4, geography, int4, int4);
+DROP FUNCTION IF EXISTS ST_AsGeoJson(geography, int4);
+DROP FUNCTION IF EXISTS ST_AsGeoJson(geography);
+DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geography);
+DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geography, int4);
+DROP FUNCTION IF EXISTS ST_AsGeoJson(geography, int4, int4);
+DROP FUNCTION IF EXISTS ST_AsGeoJson(int4, geography, int4, int4);
+
+DROP FUNCTION IF EXISTS _ST_Distance(geography, geography, float8, boolean);
+DROP FUNCTION IF EXISTS _ST_DWithin(geography, geography, float8, boolean);
+DROP FUNCTION IF EXISTS ST_Distance(geography, geography, boolean);
+DROP FUNCTION IF EXISTS ST_Distance(geography, geography);
+DROP FUNCTION IF EXISTS _ST_Expand(geography, float8);
+DROP FUNCTION IF EXISTS ST_DWithin(geography, geography, float8, boolean);
+DROP FUNCTION IF EXISTS ST_DWithin(geography, geography, float8);
+DROP FUNCTION IF EXISTS ST_Area(geography, boolean);
+DROP FUNCTION IF EXISTS ST_Area(geography);
+DROP FUNCTION IF EXISTS ST_Length(geography, boolean);
+DROP FUNCTION IF EXISTS ST_Length(geography);
+DROP FUNCTION IF EXISTS _ST_PointOutside(geography);
+DROP FUNCTION IF EXISTS _ST_Covers(geography, geography);
+DROP FUNCTION IF EXISTS ST_Covers(geography, geography);
+DROP FUNCTION IF EXISTS ST_CoveredBy(geography, geography);
+DROP FUNCTION IF EXISTS ST_Intersects(geography, geography);
+DROP FUNCTION IF EXISTS _ST_BestSRID(geography, geography);
+DROP FUNCTION IF EXISTS _ST_BestSRID(geography);
+DROP FUNCTION IF EXISTS ST_Buffer(geography, float8);
+DROP FUNCTION IF EXISTS ST_Intersection(geography, geography);
+DROP FUNCTION IF EXISTS geography(geography, integer, boolean);
+
+--DROP FUNCTION IF EXISTS geography_in(cstring, oid, integer);
+--DROP FUNCTION IF EXISTS geography_out(geography);
+DROP TYPE geography CASCADE;
+DROP FUNCTION IF EXISTS geography_typmod_in(cstring[]);
+DROP FUNCTION IF EXISTS geography_typmod_out(integer);
+DROP FUNCTION IF EXISTS geography_analyze(internal);
+
+-- DROP FUNCTION IF EXISTS gidx_in(cstring);
+-- DROP FUNCTION IF EXISTS gidx_out(gidx);
+DROP TYPE gidx CASCADE;
+
-- PostGIS - Spatial Types for PostgreSQL
-- http://postgis.refractions.net
-- Copyright 2001-2003 Refractions Research Inc.
+-- Copyright 2009 Open Source Geospatial Foundation <http://osgeo.org>
--
-- This is free software; you can redistribute and/or modify it under
-- the terms of the GNU General Public Licence. See the COPYING file.
DROP FUNCTION ST_ShortestLine(geometry, geometry);
DROP FUNCTION ST_LongestLine(geometry, geometry);
DROP FUNCTION ST_DFullyWithin(geometry, geometry, float8);
+DROP FUNCTION _ST_DumpPoints(geometry, integer[]);
+
---------------------------------------------------------------
-- SQL-MM
---------------------------------------------------------------
#include "uninstall_sqlmm.sql.in.c"
#include "uninstall_long_xact.sql.in.c"
+#include "uninstall_geography.sql.in.c"
DROP FUNCTION ST_BdMPolyFromText(text, integer);
DROP FUNCTION BdMPolyFromText(text, integer);
DROP FUNCTION IsRing(geometry);
DROP FUNCTION ST_Centroid(geometry);
DROP FUNCTION Centroid(geometry);
-DROP FUNCTION GEOSnoop(geometry);
DROP FUNCTION ST_IsValid(geometry);
DROP FUNCTION IsValid(geometry);
DROP FUNCTION ST_Overlaps(geometry,geometry);
DROP AGGREGATE collect(geometry);
DROP AGGREGATE ST_Union(geometry);
--- TO BE REMOVED BEFORE RELEASE
-DROP AGGREGATE ST_Union_Old(geometry);
--- TO BE REMOVED BEFORE RELEASE
-DROP AGGREGATE GeomUnion_Old(geometry);
-
DROP FUNCTION ST_Union (geometry[]);
DROP FUNCTION ST_unite_garray (geometry[]);
DROP FUNCTION unite_garray (geometry[]);
--- TO BE REMOVED BEFORE RELEASE
-DROP AGGREGATE ST_accum_old(geometry);
--- TO BE REMOVED BEFORE RELEASE
-DROP AGGREGATE accum_old(geometry);
-
DROP AGGREGATE ST_Accum(geometry);
DROP AGGREGATE accum(geometry);
DROP AGGREGATE ST_MemUnion(geometry);
DROP AGGREGATE MemGeomUnion(geometry);
DROP FUNCTION ST_collect(geometry[]);
-DROP FUNCTION ST_collect_garray(geometry[]);
-DROP FUNCTION collect_garray(geometry[]);
-DROP FUNCTION ST_geom_accum(geometry[],geometry);
-DROP FUNCTION geom_accum (geometry[],geometry);
DROP AGGREGATE ST_memcollect(geometry);
DROP AGGREGATE memcollect(geometry);
DROP FUNCTION ST_collect(geometry, geometry);
DROP FUNCTION collect(geometry, geometry);
-DROP FUNCTION ST_collector(geometry, geometry);
-DROP FUNCTION collector(geometry, geometry);
---------------------------------------------------------------
DROP FUNCTION ST_Intersection(geometry,geometry);
DROP FUNCTION intersection(geometry,geometry);
#if POSTGIS_GEOS_VERSION >= 32
-DROP FUNCTION ST_HausdorffDistance(geometry, geometry)
+DROP FUNCTION ST_HausdorffDistance(geometry, geometry);
#endif
#if POSTGIS_GEOS_VERSION >= 32
-DROP FUNCTION ST_HausdorffDistance(geometry, geometry, float8)
+DROP FUNCTION ST_HausdorffDistance(geometry, geometry, float8);
#endif
-----------------------------------------------------------------------
DROP FUNCTION postgis_full_version();
+DROP FUNCTION postgis_lib_version();
+DROP FUNCTION postgis_version();
DROP FUNCTION postgis_lib_build_date();
DROP FUNCTION postgis_scripts_build_date();
DROP FUNCTION postgis_geos_version();
+DROP FUNCTION postgis_libxml_version();
DROP FUNCTION postgis_uses_stats();
DROP FUNCTION postgis_scripts_released();
-DROP FUNCTION postgis_lib_version();
DROP FUNCTION postgis_scripts_installed();
DROP FUNCTION postgis_proj_version();
-DROP FUNCTION postgis_version();
-
---------------------------------------------------------------
-- PROJ support
DROP FUNCTION ST_Transform(geometry,integer);
DROP FUNCTION transform(geometry,integer);
-DROP FUNCTION transform_geometry(geometry,text,text,int);
DROP FUNCTION get_proj4_from_srid(integer);
DROP FUNCTION DumpRings(geometry);
DROP FUNCTION ST_Dump(geometry);
DROP FUNCTION Dump(geometry);
-DROP TYPE geometry_dump;
DROP FUNCTION ST_LineMerge(geometry);
DROP FUNCTION LineMerge(geometry);
DROP FUNCTION ST_Polygonize (geometry[]);
-- MISC
------------------------------------------------------------------------
-DROP FUNCTION ST_Cache_BBox();
-DROP FUNCTION cache_bbox();
DROP FUNCTION ST_GeomFromEWKT(text);
DROP FUNCTION GeomFromEWKT(text);
DROP FUNCTION ST_GeomFromEWKB(bytea);
DROP FUNCTION AsEWKT(geometry);
DROP FUNCTION ST_NDims(geometry);
DROP FUNCTION ndims(geometry);
-DROP FUNCTION ST_HasBBOX(geometry);
DROP FUNCTION hasBBOX(geometry);
+DROP FUNCTION postgis_cache_bbox();
DROP FUNCTION ST_zmflag(geometry);
DROP FUNCTION zmflag(geometry);
-DROP FUNCTION ST_noop(geometry);
DROP FUNCTION noop(geometry);
DROP FUNCTION ST_ForceRHR(geometry);
DROP FUNCTION ForceRHR(geometry);
DROP FUNCTION azimuth(geometry,geometry);
DROP FUNCTION ST_point_inside_circle(geometry,float8,float8,float8);
DROP FUNCTION point_inside_circle(geometry,float8,float8,float8);
-DROP FUNCTION ST_max_distance(geometry,geometry);
+DROP FUNCTION _ST_MaxDistance(geometry,geometry);
+DROP FUNCTION ST_maxdistance(geometry,geometry);
DROP FUNCTION max_distance(geometry,geometry);
DROP FUNCTION ST_Distance(geometry,geometry);
DROP FUNCTION distance(geometry,geometry);
DROP FUNCTION getBBOX(geometry);
DROP FUNCTION getSRID(geometry);
-DROP FUNCTION ST_dropBBOX(geometry);
DROP FUNCTION dropBBOX(geometry);
-DROP FUNCTION ST_addBBOX(geometry);
DROP FUNCTION addBBOX(geometry);
DROP FUNCTION geometry_lt(geometry, geometry);
----- BOX2D support functions
-
-DROP FUNCTION ST_box2d_intersects(box2d, box2d);
-DROP FUNCTION box2d_intersects(box2d, box2d);
-DROP FUNCTION ST_box2d_same(box2d, box2d);
-DROP FUNCTION box2d_same(box2d, box2d);
-DROP FUNCTION ST_box2d_overlap(box2d, box2d);
-DROP FUNCTION box2d_overlap(box2d, box2d);
-DROP FUNCTION ST_box2d_contained(box2d, box2d);
-DROP FUNCTION box2d_contained(box2d, box2d);
-DROP FUNCTION ST_box2d_contain(box2d, box2d);
-DROP FUNCTION box2d_contain(box2d, box2d);
-DROP FUNCTION ST_box2d_right(box2d, box2d);
-DROP FUNCTION box2d_right(box2d, box2d);
-DROP FUNCTION ST_box2d_left(box2d, box2d);
-DROP FUNCTION box2d_left(box2d, box2d);
-DROP FUNCTION ST_box2d_overright(box2d, box2d);
-DROP FUNCTION box2d_overright(box2d, box2d);
-DROP FUNCTION ST_box2d_overleft(box2d, box2d);
-DROP FUNCTION box2d_overleft(box2d, box2d);
-
-----------------------------------------------------------------------
-- BOX2D
DROP FUNCTION Affine(geometry,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8,float8);
+-------------------------------------------------------------------
+-- GEOMETRY TYPE (geometry_dump)
+-------------------------------------------------------------------
+DROP TYPE geometry_dump CASCADE;
+
-------------------------------------------------------------------
-- GEOMETRY TYPE (lwgeom)
-------------------------------------------------------------------
DROP FUNCTION ST_geometry_analyze(internal);
DROP FUNCTION geometry_analyze(internal);
+DROP FUNCTION geometry_gist_sel (internal, oid, internal, int4);
+DROP FUNCTION geometry_gist_joinsel(internal, oid, internal, smallint);
-------------------------------------------------------------------
-- SPHEROID TYPE