From 6bbc07b9071c5bcb02608fbce5c583ff5b357531 Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Tue, 13 Nov 2018 19:47:59 +0000 Subject: [PATCH] SP-GiST within got into 3.0.0 not 2.5.0. References #4230 git-svn-id: http://svn.osgeo.org/postgis/trunk@17010 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/postgis.sql.in | 12 ++++++------ postgis/postgis_spgist.sql.in | 28 ++++++++++++++-------------- utils/postgis_proc_upgrade.pl | 6 +++++- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 07c0d80b0..3725409f0 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -824,13 +824,13 @@ CREATE OPERATOR &&& ( JOIN = gserialized_gist_joinsel_nd ); --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_contains_nd(geometry, geometry) RETURNS boolean AS 'MODULE_PATHNAME' ,'gserialized_contains' LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OPERATOR ~~ ( LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_contains_nd, COMMUTATOR = '@@', @@ -838,13 +838,13 @@ CREATE OPERATOR ~~ ( JOIN = gserialized_gist_joinsel_nd ); --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_within_nd(geometry, geometry) RETURNS boolean AS 'MODULE_PATHNAME' ,'gserialized_within' LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OPERATOR @@ ( LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_within_nd, COMMUTATOR = '~~', @@ -852,13 +852,13 @@ CREATE OPERATOR @@ ( JOIN = gserialized_gist_joinsel_nd ); --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_same_nd(geometry, geometry) RETURNS boolean AS 'MODULE_PATHNAME' ,'gserialized_same' LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OPERATOR ~~= ( LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_same_nd, COMMUTATOR = '~~=', diff --git a/postgis/postgis_spgist.sql.in b/postgis/postgis_spgist.sql.in index 3fd2424e4..70617db21 100644 --- a/postgis/postgis_spgist.sql.in +++ b/postgis/postgis_spgist.sql.in @@ -172,38 +172,38 @@ CREATE OPERATOR CLASS spgist_geometry_ops_3d -- Geometry -- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_spgist_config_nd(internal, internal) RETURNS void AS 'MODULE_PATHNAME' ,'gserialized_spgist_config_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_spgist_choose_nd(internal, internal) RETURNS void AS 'MODULE_PATHNAME' ,'gserialized_spgist_choose_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_spgist_picksplit_nd(internal, internal) RETURNS void AS 'MODULE_PATHNAME' ,'gserialized_spgist_picksplit_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_spgist_inner_consistent_nd(internal, internal) RETURNS void AS 'MODULE_PATHNAME' ,'gserialized_spgist_inner_consistent_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_spgist_leaf_consistent_nd(internal, internal) RETURNS bool AS 'MODULE_PATHNAME' ,'gserialized_spgist_leaf_consistent_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geometry_spgist_compress_nd(internal) RETURNS internal AS 'MODULE_PATHNAME' ,'gserialized_spgist_compress_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OPERATOR CLASS spgist_geometry_ops_nd FOR TYPE geometry USING SPGIST AS OPERATOR 3 &&& , @@ -221,38 +221,38 @@ CREATE OPERATOR CLASS spgist_geometry_ops_nd -- Geography -- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geography_spgist_config_nd(internal, internal) RETURNS void AS 'MODULE_PATHNAME' ,'gserialized_spgist_config_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geography_spgist_choose_nd(internal, internal) RETURNS void AS 'MODULE_PATHNAME' ,'gserialized_spgist_choose_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geography_spgist_picksplit_nd(internal, internal) RETURNS void AS 'MODULE_PATHNAME' ,'gserialized_spgist_picksplit_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geography_spgist_inner_consistent_nd(internal, internal) RETURNS void AS 'MODULE_PATHNAME' ,'gserialized_spgist_inner_consistent_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geography_spgist_leaf_consistent_nd(internal, internal) RETURNS bool AS 'MODULE_PATHNAME' ,'gserialized_spgist_leaf_consistent_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OR REPLACE FUNCTION geography_spgist_compress_nd(internal) RETURNS internal AS 'MODULE_PATHNAME' ,'gserialized_spgist_compress_nd' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; --- Availability: 2.5.0 +-- Availability: 3.0.0 CREATE OPERATOR CLASS spgist_geography_ops_nd DEFAULT FOR TYPE geography USING SPGIST AS OPERATOR 3 && , diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl index 8fb397de2..9a10ef246 100755 --- a/utils/postgis_proc_upgrade.pl +++ b/utils/postgis_proc_upgrade.pl @@ -402,10 +402,14 @@ EOF chop $subdefn; $subdefn =~ s/[,;]$//; # strip ending comma or semicolon # argument types must be specified in ALTER OPERATOR FAMILY - if ( $subdefn =~ m/\s+(OPERATOR.*)/ ) + if ( $subdefn =~ m/\s+(OPERATOR.*)(FOR.*)/ ) { $subdefn = $1.'('.$opctype.','.$opctype.') '.$2; } + elsif ( $subdefn =~ m/\s+(OPERATOR.*)/ ) + { + $subdefn = $1.'('.$opctype.','.$opctype.') ' + } elsif ( $subdefn =~ m/\s+(FUNCTION\s+[0-9]+ )(.*)/ ) { $subdefn = $1.'('.$opctype.','.$opctype.') '.$2; -- 2.40.0