-- $Id$
--
-- PostGIS - Spatial Types for PostgreSQL
--- http://postgis.refractions.net
+-- http://postgis.net
--
-- Copyright (C) 2011-2012 Sandro Santilli <strk@keybit.net>
--- Copyright (C) 2010-2012 Regina Obe <lr@pcorp.us>
+-- Copyright (C) 2010-2013 Regina Obe <lr@pcorp.us>
-- Copyright (C) 2009 Paul Ramsey <pramsey@cleverelephant.ca>
--
-- This is free software; you can redistribute and/or modify it under
DROP FUNCTION IF EXISTS ST_AsX3D(geometry, integer, integer);
--changed name of arg: http://trac.osgeo.org/postgis/ticket/1606
DROP FUNCTION IF EXISTS UpdateGeometrySRID(varchar,varchar,varchar,varchar,integer);
+
+--deprecated and removed in 2.1
+-- Hack to fix 2.0 naming
+-- We can't just drop it since its bound to opclass
+-- See ticket 2279 for why we need to do this
+-- We can get rid of this DO code when 3.0 comes along
+DO language 'plpgsql' $$
+BEGIN
+ -- fix geometry ops --
+ IF EXISTS(SELECT oprname from pg_operator where oprname = '&&' AND oprrest::text = 'geometry_gist_sel_2d') THEN
+ --it is bound to old name, drop new, rename old to new, install will fix body of code
+ DROP FUNCTION IF EXISTS gserialized_gist_sel_2d(internal, oid, internal, int4) ;
+ ALTER FUNCTION geometry_gist_sel_2d(internal, oid, internal, int4) RENAME TO gserialized_gist_sel_2d;
+ END IF;
+ IF EXISTS(SELECT oprname from pg_operator where oprname = '&&' AND oprjoin::text = 'geometry_gist_joinsel_2d') THEN
+ --it is bound to old name, drop new, rename old to new, install will fix body of code
+ DROP FUNCTION IF EXISTS gserialized_gist_joinsel_2d(internal, oid, internal, smallint) ;
+ ALTER FUNCTION geometry_gist_joinsel_2d(internal, oid, internal, smallint) RENAME TO gserialized_gist_joinsel_2d;
+ END IF;
+ -- fix geography ops --
+ IF EXISTS(SELECT oprname from pg_operator where oprname = '&&' AND oprrest::text = 'geography_gist_selectivity') THEN
+ --it is bound to old name, drop new, rename old to new, install will fix body of code
+ DROP FUNCTION IF EXISTS gserialized_gist_sel_nd(internal, oid, internal, smallint) ;
+ ALTER FUNCTION geography_gist_selectivity(internal, oid, internal, int4) RENAME TO gserialized_gist_sel_nd;
+ END IF;
+
+ IF EXISTS(SELECT oprname from pg_operator where oprname = '&&' AND oprjoin::text = 'geography_gist_join_selectivity') THEN
+ --it is bound to old name, drop new, rename old to new, install will fix body of code
+ DROP FUNCTION IF EXISTS gserialized_gist_joinsel_nd(internal, oid, internal, int4) ;
+ ALTER FUNCTION geography_gist_join_selectivity(internal, oid, internal, smallint) RENAME TO gserialized_gist_joinsel_nd;
+ END IF;
+END;
+$$ ;