mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Convert contrib modules to use the extension facility.
This isn't fully tested as yet, in particular I'm not sure that the "foo--unpackaged--1.0.sql" scripts are OK. But it's time to get some buildfarm cycles on it. sepgsql is not converted to an extension, mainly because it seems to require a very nonstandard installation process. Dimitri Fontaine and Tom Lane
This commit is contained in:
1
contrib/earthdistance/.gitignore
vendored
1
contrib/earthdistance/.gitignore
vendored
@ -1,3 +1,2 @@
|
||||
/earthdistance.sql
|
||||
# Generated subdirectories
|
||||
/results/
|
||||
|
@ -1,8 +1,10 @@
|
||||
# contrib/earthdistance/Makefile
|
||||
|
||||
MODULES = earthdistance
|
||||
DATA_built = earthdistance.sql
|
||||
DATA = uninstall_earthdistance.sql
|
||||
|
||||
EXTENSION = earthdistance
|
||||
DATA = earthdistance--1.0.sql earthdistance--unpackaged--1.0.sql
|
||||
|
||||
REGRESS = earthdistance
|
||||
|
||||
LDFLAGS_SL += $(filter -lm, $(LIBS))
|
||||
|
@ -1,9 +1,4 @@
|
||||
/* contrib/earthdistance/earthdistance.sql.in */
|
||||
|
||||
-- Adjust this setting to control where the objects get created.
|
||||
SET search_path = public;
|
||||
|
||||
-- The earth functions rely on contrib/cube having been installed and loaded.
|
||||
/* contrib/earthdistance/earthdistance--1.0.sql */
|
||||
|
||||
-- earth() returns the radius of the earth in meters. This is the only
|
||||
-- place you need to change things for the cube base distance functions
|
13
contrib/earthdistance/earthdistance--unpackaged--1.0.sql
Normal file
13
contrib/earthdistance/earthdistance--unpackaged--1.0.sql
Normal file
@ -0,0 +1,13 @@
|
||||
/* contrib/earthdistance/earthdistance--unpackaged--1.0.sql */
|
||||
|
||||
ALTER EXTENSION earthdistance ADD function earth();
|
||||
ALTER EXTENSION earthdistance ADD type earth;
|
||||
ALTER EXTENSION earthdistance ADD function sec_to_gc(double precision);
|
||||
ALTER EXTENSION earthdistance ADD function gc_to_sec(double precision);
|
||||
ALTER EXTENSION earthdistance ADD function ll_to_earth(double precision,double precision);
|
||||
ALTER EXTENSION earthdistance ADD function latitude(earth);
|
||||
ALTER EXTENSION earthdistance ADD function longitude(earth);
|
||||
ALTER EXTENSION earthdistance ADD function earth_distance(earth,earth);
|
||||
ALTER EXTENSION earthdistance ADD function earth_box(earth,double precision);
|
||||
ALTER EXTENSION earthdistance ADD function geo_distance(point,point);
|
||||
ALTER EXTENSION earthdistance ADD operator <@>(point,point);
|
6
contrib/earthdistance/earthdistance.control
Normal file
6
contrib/earthdistance/earthdistance.control
Normal file
@ -0,0 +1,6 @@
|
||||
# earthdistance extension
|
||||
comment = 'calculate great-circle distances on the surface of the Earth'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/earthdistance'
|
||||
relocatable = true
|
||||
requires = 'cube'
|
@ -1,13 +1,8 @@
|
||||
--
|
||||
-- Test earth distance functions
|
||||
--
|
||||
--
|
||||
-- first, define the datatype. Turn off echoing so that expected file
|
||||
-- does not depend on contents of earthdistance.sql or cube.sql.
|
||||
--
|
||||
SET client_min_messages = warning;
|
||||
\set ECHO none
|
||||
RESET client_min_messages;
|
||||
CREATE EXTENSION cube;
|
||||
CREATE EXTENSION earthdistance;
|
||||
--
|
||||
-- The radius of the Earth we are using.
|
||||
--
|
||||
|
@ -2,16 +2,8 @@
|
||||
-- Test earth distance functions
|
||||
--
|
||||
|
||||
--
|
||||
-- first, define the datatype. Turn off echoing so that expected file
|
||||
-- does not depend on contents of earthdistance.sql or cube.sql.
|
||||
--
|
||||
SET client_min_messages = warning;
|
||||
\set ECHO none
|
||||
\i ../cube/cube.sql
|
||||
\i earthdistance.sql
|
||||
\set ECHO all
|
||||
RESET client_min_messages;
|
||||
CREATE EXTENSION cube;
|
||||
CREATE EXTENSION earthdistance;
|
||||
|
||||
--
|
||||
-- The radius of the Earth we are using.
|
||||
|
@ -1,26 +0,0 @@
|
||||
/* contrib/earthdistance/uninstall_earthdistance.sql */
|
||||
|
||||
-- Adjust this setting to control where the objects get dropped.
|
||||
SET search_path = public;
|
||||
|
||||
DROP OPERATOR <@> (point, point);
|
||||
|
||||
DROP FUNCTION geo_distance (point, point);
|
||||
|
||||
DROP FUNCTION earth_box(earth, float8);
|
||||
|
||||
DROP FUNCTION earth_distance(earth, earth);
|
||||
|
||||
DROP FUNCTION longitude(earth);
|
||||
|
||||
DROP FUNCTION latitude(earth);
|
||||
|
||||
DROP FUNCTION ll_to_earth(float8, float8);
|
||||
|
||||
DROP FUNCTION gc_to_sec(float8);
|
||||
|
||||
DROP FUNCTION sec_to_gc(float8);
|
||||
|
||||
DROP DOMAIN earth;
|
||||
|
||||
DROP FUNCTION earth();
|
Reference in New Issue
Block a user