[postgis-tickets] [SCM] PostGIS; Spatial objects for PostgreSQL. branch master updated. ff0845764e7fdb182abf2f5d5f0df1d1fc64bcd3

git at osgeo.org git at osgeo.org
Fri Nov 15 03:07:47 PST 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS; Spatial objects for PostgreSQL.".

The branch, master has been updated
       via  ff0845764e7fdb182abf2f5d5f0df1d1fc64bcd3 (commit)
      from  de298f1b42a8ae2e8c7f9137d904712c33bf9c45 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ff0845764e7fdb182abf2f5d5f0df1d1fc64bcd3
Author: Raúl Marín <git at rmr.ninja>
Date:   Fri Nov 15 10:56:32 2019 +0100

    Drop postgis_proc_set_search_path.pl
    
    Closes #4579

diff --git a/.gitignore b/.gitignore
index 5213c3b..bc0d770 100644
--- a/.gitignore
+++ b/.gitignore
@@ -108,7 +108,6 @@ postgis/legacy_gist.sql
 postgis/legacy_minimal.sql
 postgis/legacy.sql
 postgis/postgis.sql
-postgis/postgis_proc_set_search_path.sql
 postgis/postgis_for_extension.sql
 postgis/postgis_upgrade.sql*
 postgis/postgis_upgrade_for_extension.sql
@@ -128,7 +127,6 @@ raster/rt_pg/Makefile
 raster/rt_pg/rtpostgis.sql
 raster/rt_pg/rtpostgis_drop.sql
 raster/rt_pg/rtpostgis_legacy.sql
-raster/rt_pg/rtpostgis_proc_set_search_path.sql
 raster/rt_pg/rtpostgis_for_extension.sql
 raster/rt_pg/rtpostgis_upgrade.sql.in
 raster/rt_pg/rtpostgis_upgrade*.sql
diff --git a/NEWS b/NEWS
index bf91482..13e1b4b 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ PostGIS 3.1.0
 
 * Breaking changes *
   - #4577, Drop support for PostgreSQL 9.5 (Raúl Marín)
+  - #4579, Drop postgis_proc_set_search_path.pl (Raúl Marín)
 
 * New features *
 
diff --git a/postgis/Makefile.in b/postgis/Makefile.in
index 5293e0c..3f0b40d 100644
--- a/postgis/Makefile.in
+++ b/postgis/Makefile.in
@@ -34,7 +34,7 @@ MODULE_big=postgis- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@
 endif
 
 # Files to be copied to the contrib/ directory
-SQL_built=postgis.sql uninstall_postgis.sql postgis_upgrade.sql postgis_proc_set_search_path.sql legacy.sql uninstall_legacy.sql legacy_minimal.sql legacy_gist.sql
+SQL_built=postgis.sql uninstall_postgis.sql postgis_upgrade.sql legacy.sql uninstall_legacy.sql legacy_minimal.sql legacy_gist.sql
 DATA=../spatial_ref_sys.sql
 
 # SQL objects (files requiring pre-processing)
@@ -241,8 +241,6 @@ endif
 postgis_upgrade.sql.in: postgis.sql ../utils/postgis_proc_upgrade.pl
 	$(PERL) ../utils/postgis_proc_upgrade.pl $< UNUSED > $@
 
-postgis_proc_set_search_path.sql: postgis.sql ../utils/postgis_proc_set_search_path.pl
-	$(PERL) ../utils/postgis_proc_set_search_path.pl $< UNUSED > $@
 
 postgis_upgrade.sql: postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_after_upgrade.sql
 	echo "BEGIN;" > $@
diff --git a/raster/rt_pg/Makefile.in b/raster/rt_pg/Makefile.in
index ef83534..96a5a37 100644
--- a/raster/rt_pg/Makefile.in
+++ b/raster/rt_pg/Makefile.in
@@ -31,7 +31,7 @@ MODULE_big=$(MODULE_NAME)- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@
 endif
 
 # Files to be copied to the contrib/ directory
-DATA_built=rtpostgis.sql rtpostgis_upgrade.sql rtpostgis_proc_set_search_path.sql uninstall_rtpostgis.sql rtpostgis_legacy.sql
+DATA_built=rtpostgis.sql rtpostgis_upgrade.sql uninstall_rtpostgis.sql rtpostgis_legacy.sql
 DATA=
 
 # SQL preprocessor
@@ -137,9 +137,6 @@ $(SQL_OBJS): ../../postgis/sqldefines.h ../../postgis_revision.h
 rtpostgis_upgrade.sql.in: rtpostgis.sql ../../utils/postgis_proc_upgrade.pl
 	$(PERL) ../../utils/postgis_proc_upgrade.pl $< UNUSED > $@
 
-rtpostgis_proc_set_search_path.sql: rtpostgis.sql ../../utils/postgis_proc_set_search_path.pl
-	$(PERL) ../../utils/postgis_proc_set_search_path.pl $< UNUSED > $@
-
 rtpostgis_upgrade.sql: rtpostgis_upgrade_cleanup.sql rtpostgis_upgrade.sql.in rtpostgis_drop.sql
 	echo 'BEGIN;' > $@
 	cat $^ | sed -e 's/^BEGIN;$$//' -e 's/^COMMIT;$$//' >> $@
diff --git a/regress/run_test.pl b/regress/run_test.pl
index 50e2032..16a1290 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -1479,7 +1479,6 @@ sub prepare_spatial
 	# Load postgis.sql into the database
 	load_sql_file("${scriptdir}/postgis.sql", 1);
 	load_sql_file("${scriptdir}/postgis_comments.sql", 0);
-	load_sql_file("${scriptdir}/postgis_proc_set_search_path.sql", 0);
 	load_sql_file("${scriptdir}/spatial_ref_sys.sql", 0);
 
 	if ( $OPT_WITH_TOPO )
@@ -1494,7 +1493,6 @@ sub prepare_spatial
 		print "Loading Raster into '${DB}'\n";
 		load_sql_file("${scriptdir}/rtpostgis.sql", 1);
 		load_sql_file("${scriptdir}/raster_comments.sql", 0);
-		load_sql_file("${scriptdir}/rtpostgis_proc_set_search_path.sql", 0);
 	}
 
 	if ( $OPT_WITH_SFCGAL )
diff --git a/utils/postgis_proc_set_search_path.pl b/utils/postgis_proc_set_search_path.pl
deleted file mode 100644
index 8425787..0000000
--- a/utils/postgis_proc_set_search_path.pl
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/usr/bin/perl -w
-
-#
-# PostGIS - Spatial Types for PostgreSQL
-# http://postgis.net
-#
-# Copyright (C) 2016 Regina Obe <lr at pcorp.us>
-#
-# This is free software; you can redistribute and/or modify it under
-# the terms of the GNU General Public Licence. See the COPYING file.
-#
-
-#
-# This script produces an .sql file containing
-# ALTER FUNCTION SET PATH calls for each function
-# in postgis.sql
-
-# Having postgis functions force the search path 
-# to just where postgis is installed is needed
-# so that functions that call other functions during 
-# database restore, materialized view creation, foreign table calls
-# will always be able to find the companion functions
-#
-
-eval "exec perl -w $0 $@"
-	if (0);
-
-use strict;
-use warnings;
-
-#
-# Commandline argument handling
-#
-($#ARGV == 0) ||
-die "Usage: perl postgis_proc_set_path.pl <postgis.sql> <version_from> [<schema>]\nCreates a new SQL script 
-to set search path for all functions in input script file.\n"
-	if ( @ARGV < 1 || @ARGV > 3 );
-
-my $sql_file = $ARGV[0];
-my $module = 'postgis';
-my $soname = '';
-my $version_to = "";
-my $version_to_num = 0;
-my $version_from = $ARGV[1];
-my $version_from_num = 0;
-my $schema = "";
-$schema = $ARGV[2] if @ARGV > 2;
-
-die "Unable to open input SQL file $sql_file\n"
-	if ( ! -f $sql_file );
-
-## Header of do	
-print 'DO language plpgsql $$';
-my $dofunc_start = <<"EOF";
-DECLARE param_postgis_schema text;
-BEGIN
--- check if PostGIS is already installed
-param_postgis_schema = (SELECT n.nspname from pg_extension e join pg_namespace n on e.extnamespace = n.oid WHERE extname = 'postgis');
-
--- if in middle install, it will be the current_schema or what was there already
-param_postgis_schema = COALESCE(param_postgis_schema, current_schema());
-
-IF param_postgis_schema != current_schema() THEN
-	EXECUTE 'set search_path TO ' || quote_ident(param_postgis_schema);
-END IF;
-
--- PostGIS set search path of functions
-EOF
-print $dofunc_start;
-
-#
-# Search the SQL file for the target version number (the 
-# version we are upgrading *to*.
-#
-open( INPUT, $sql_file ) || die "Couldn't open file: $sql_file\n";
-
-
-print qq{
---
--- ALTER FUNCTION script
---
-
-};
-
-#print "BEGIN;\n";
-print "SET search_path TO $schema;\n" if $schema;
-
-#
-# Go through the SQL file and find all functions
-# for each create an ALTER FUNCTION statement
-# to set the search_path to schema postgis is installed in
-open( INPUT, $sql_file ) || die "Couldn't open file: $sql_file\n";
-while(<INPUT>)
-{
-
-	if ( /^create or replace function([^\)]+)([\)]{0,1})/i )
-	{
-		my $funchead = $1; # contains function header except the end )
-		my $endhead = 0;
-		my $endfunchead = $2;
-		my $search_path_safe = -1; # we can put a search path on it without disrupting spatial index use
-		
-		if ($2 eq ')') ## reached end of header
-		{
-			$endhead = 1;
-		}
-		
-		if ( /((add|drop)[\_]*(geometry|overview|raster)|internal)/i){
-			# can't put search_path on addgeometrycolumn or addrasterconstraints 
-			# since table names are sometimes passed in non-qualified
-			# also can't work on some functions that take internals
-			$search_path_safe = 0; 
-		}
-		
-		if ( /st_transform/i){
-			# st_transform functions query spatial_ref_sys
-			# so could fail in materialized views and spatial indexes,
-			# though often all done in C
-			$search_path_safe = 1; 
-		}
-
-		
-		#raster folks decided to break their func head in multiple lines 
-		# so we need to do this crazy thing
-		if ($endhead != 1)
-		{
-			while(<INPUT>)
-			{
-				#look for expressions with no ( and optionally ending in )
-				if ( /^([^\)]*)([\)]{0,1})/i )
-				{
-					$funchead .= $1;
-					$endfunchead = $2;
-					if ($2 eq ')') ## reached end of header
-					{
-						$endhead = 1;
-						
-					}
-				}
-				last if ( $endhead );
-	
-			}
-		}
-		#strip quoted , trips up the default strip
-		$funchead =~ s/(',')+//ig;
-		#strip off default args from the function header
-		$funchead =~ s/(default\s+[A-Za-z\.\+\-0-9\'\[\]\:\s]*)//ig;
-		
-		#check to see if function is STRICT or c or plpgsql
-		# we can't put search path on non-STRICT sql since search path breaks SQL inlining
-		# breaking sql inlining will break use of spatial index
-		my $endfunc = 0;
-		while(<INPUT>)
-		{
-			$endfunc = 1 if /^\s*(\$\$\s*)?LANGUAGE /i;
-			if ( $endfunc == 1 && $search_path_safe == -1 ){
-				$search_path_safe = 1 if /LANGUAGE\s+[\']*(plpgsql)/i;
-				$search_path_safe = 1 if /STRICT/i;
-				#exclude C functions unless we've include, 
-				# in most cases except ST_Transform
-				# c functions don't call dependent functions or tables
-				$search_path_safe = 0 if /LANGUAGE\s+[\']*(c)/i;
-			}
-			last if ( $endfunc && /\;/ );
-		}
-
-		
-		if ($search_path_safe == 1)
-		{
-			print "EXECUTE 'ALTER FUNCTION $funchead $endfunchead SET search_path=' || quote_ident(param_postgis_schema) || ',pg_catalog;';\n";
-		}
-	}
-
-}
-
-close( INPUT );
-
-## End of DO
-print 'END;';
-print '$$;';
-
-__END__
- 

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                            |   2 -
 NEWS                                  |   1 +
 postgis/Makefile.in                   |   4 +-
 raster/rt_pg/Makefile.in              |   5 +-
 regress/run_test.pl                   |   2 -
 utils/postgis_proc_set_search_path.pl | 183 ----------------------------------
 6 files changed, 3 insertions(+), 194 deletions(-)
 delete mode 100644 utils/postgis_proc_set_search_path.pl


hooks/post-receive
-- 
PostGIS; Spatial objects for PostgreSQL.


More information about the postgis-tickets mailing list