diff --git a/contrib/cube/cube.control b/contrib/cube/cube.control index 50427ec117..8af637c901 100644 --- a/contrib/cube/cube.control +++ b/contrib/cube/cube.control @@ -2,5 +2,5 @@ comment = 'data type for multidimensional cubes' default_version = '1.5' module_pathname = '$libdir/cube' -relocatable = true +relocatable = false trusted = true diff --git a/contrib/earthdistance/Makefile b/contrib/earthdistance/Makefile index f93b7a925a..fa648be831 100644 --- a/contrib/earthdistance/Makefile +++ b/contrib/earthdistance/Makefile @@ -3,7 +3,7 @@ MODULES = earthdistance EXTENSION = earthdistance -DATA = earthdistance--1.1.sql earthdistance--1.0--1.1.sql +DATA = earthdistance--1.1.sql earthdistance--1.0--1.1.sql earthdistance--1.1--1.2.sql PGFILEDESC = "earthdistance - calculate distances on the surface of the Earth" REGRESS = earthdistance diff --git a/contrib/earthdistance/earthdistance--1.1--1.2.sql b/contrib/earthdistance/earthdistance--1.1--1.2.sql new file mode 100644 index 0000000000..64e431b8d8 --- /dev/null +++ b/contrib/earthdistance/earthdistance--1.1--1.2.sql @@ -0,0 +1,30 @@ +/* contrib/earthdistance/earthdistance--1.1--1.2.sql */ + +-- complain if script is sourced in psql, rather than via ALTER EXTENSION +\echo Use "ALTER EXTENSION earthdistance UPDATE TO '1.2'" to load this file. \quit + +DO LANGUAGE plpgsql +$$ +DECLARE + v_cubenspname TEXT; +BEGIN + SELECT nspname INTO v_cubenspname + FROM pg_extension, pg_namespace + WHERE pg_extension.extnamespace = pg_namespace.oid + AND extname='cube'; + + IF v_cubenspname != '@extschema@' THEN + RAISE EXCEPTION 'earthdistance extension must be installed in the same schema as the cube extension'; + END IF; +END +$$; + +ALTER FUNCTION earth() SET SEARCH_PATH=@extschema@; +ALTER FUNCTION sec_to_gc(float8) SET SEARCH_PATH=@extschema@; +ALTER FUNCTION gc_to_sec(float8) SET SEARCH_PATH=@extschema@; +ALTER FUNCTION ll_to_earth(float8, float8) SET SEARCH_PATH=@extschema@; +ALTER FUNCTION latitude(earth) SET SEARCH_PATH=@extschema@; +ALTER FUNCTION longitude(earth) SET SEARCH_PATH=@extschema@; +ALTER FUNCTION earth_distance(earth, earth) SET SEARCH_PATH=@extschema@; +ALTER FUNCTION earth_box(earth, float8) SET SEARCH_PATH=@extschema@; +ALTER FUNCTION geo_distance(point, point) SET SEARCH_PATH=@extschema@; diff --git a/contrib/earthdistance/earthdistance.control b/contrib/earthdistance/earthdistance.control index 5816d22cdd..834eca2906 100644 --- a/contrib/earthdistance/earthdistance.control +++ b/contrib/earthdistance/earthdistance.control @@ -1,6 +1,6 @@ # earthdistance extension comment = 'calculate great-circle distances on the surface of the Earth' -default_version = '1.1' +default_version = '1.2' module_pathname = '$libdir/earthdistance' -relocatable = true +relocatable = false requires = 'cube'